From 5f761ca52434c4b53507956fe0cda9b1c5d73ca2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 4 Aug 2022 16:41:59 +0200 Subject: [PATCH] meta: fork branch in preparation for LTS --- .github/workflows/release-candidate.yml | 13 +++++-------- .github/workflows/release.yml | 2 +- private/release/config.js | 2 +- private/release/getUpToDateRefsFromGitHub.js | 8 ++++---- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index d2e7fdb713..8646b4cc07 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -12,12 +12,7 @@ jobs: uses: actions/checkout@v3 with: branch: release - - name: Rebase - run: | - git fetch origin HEAD --depth=1 - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - git rebase FETCH_HEAD + fetch-depth: 2 - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" @@ -50,18 +45,20 @@ jobs: jq -r 'map(.cwd) | join("\n")' < releases.json | awk '{ print "git add " $0 "/package.json" }' | sh - name: Commit run: | - echo "Release: uppy@$(jq -r 'map(select(.ident == "uppy"))[0].newVersion' < releases.json)" > commitMessage + echo "Release: uppy@$(jq -r 'map(select(.ident == "uppy"))[0].newVersion' < releases.json) (Maintenance)" > commitMessage echo >> commitMessage echo "This is a release candidate for the following packages:" >> commitMessage echo >> commitMessage jq -r 'map("- `"+.ident+"`: "+.oldVersion+" -> "+.newVersion) | join("\n") ' < releases.json >> commitMessage + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" git commit -n --amend --file commitMessage - name: Open Pull Request id: pr_opening run: | git push origin HEAD:release-candidate gh api repos/${{ github.repository }}/pulls \ - -F base="$(gh api /repos/${{ github.repository }} | jq -r .default_branch)" \ + -F base="2.x" \ -F head="release-candidate" \ -F title="$(head -1 commitMessage)" \ -F body="$(git --no-pager diff HEAD^ -- CHANGELOG.md | awk '{ if( substr($0,0,1) == "+" && $1 != "+##" && $1 != "+Released:" && $1 != "+++" ) { print substr($0,2) } }')" \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a036624b6b..7bfa283101 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: id: uppyVersion run: jq -r '"##[set-output name=version;]"+.version' < packages/uppy/package.json - name: Create GitHub release - run: gh release create uppy@${{ steps.uppyVersion.outputs.version }} -t "Uppy ${{ steps.uppyVersion.outputs.version }}" -F CHANGELOG.diff.md + run: gh release create uppy@${{ steps.uppyVersion.outputs.version }} -t "Uppy ${{ steps.uppyVersion.outputs.version }} (Maintenance)" -F CHANGELOG.diff.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload `uppy` to CDN diff --git a/private/release/config.js b/private/release/config.js index 88ab626e50..f8ee1b7a8d 100644 --- a/private/release/config.js +++ b/private/release/config.js @@ -1,3 +1,3 @@ export const REPO_OWNER = 'transloadit' export const REPO_NAME = 'uppy' -export const TARGET_BRANCH = 'main' +export const TARGET_BRANCH = '2.x' diff --git a/private/release/getUpToDateRefsFromGitHub.js b/private/release/getUpToDateRefsFromGitHub.js index e67d3cb130..e72d676cbe 100644 --- a/private/release/getUpToDateRefsFromGitHub.js +++ b/private/release/getUpToDateRefsFromGitHub.js @@ -25,10 +25,10 @@ export async function getRemoteHEAD () { } async function getLatestReleaseSHA () { - const { tag_name } = await apiCall( - `/releases/latest`, - 'Cannot get latest release from GitHub, check your internet connection.', - ) + const response = await fetch(`https://raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/${TARGET_BRANCH}/packages/uppy/package.json`) + if (!response.ok) throw new Error(`Network call failed: ${response.status} ${response.statusText}`) + const { version } = await response.json() + const tag_name = `uppy@${version}` console.log(`Last release was ${tag_name}.`) return ( await apiCall(