Prepare next release #133
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release 3.x candidate | |
on: | |
push: | |
branches: release-3.x | |
env: | |
RELEASE_LINE_BRANCH: 3.x | |
YARN_ENABLE_GLOBAL_CACHE: false | |
jobs: | |
prepare-lts-release: | |
name: Prepare release candidate Pull Request | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
branch: release-3.x | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: | |
echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: corepack yarn install --immutable | |
env: | |
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation | |
CYPRESS_INSTALL_BINARY: 0 | |
- name: Bump candidate packages version | |
run: corepack yarn version apply --all --json | jq -s > releases.json | |
- name: Prepare changelog | |
run: | |
corepack yarn workspace @uppy-dev/release update-changelogs | |
releases.json | xargs git add | |
- name: Update CDN URLs | |
run: | |
corepack yarn workspace @uppy-dev/release update-version-URLs | xargs | |
git add | |
- name: Stage changes and remove temp files | |
run: | | |
git rm -rf .yarn/versions | |
git rm CHANGELOG.next.md | |
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 >> 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 "[email protected]" | |
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="$RELEASE_LINE_BRANCH" \ | |
-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) } }')" \ | |
--jq '.number | tostring | "pr_number="+.' >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Assign to the releaser | |
run: | |
echo '{"assignees":[${{ toJSON(github.actor) }}]}' | gh api repos/${{ | |
github.repository }}/issues/${{ steps.pr_opening.outputs.pr_number | |
}}/assignees --input - | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Enable Release workflow | |
run: gh workflow enable Release --repo ${{ github.repository }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |