1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
on:
workflow_dispatch:
inputs:
apply_versions:
description: 'Apply new versions?'
required: false
default: '1'
env:
node-version: '18.x'
name: 'Release Candidate'
jobs:
release:
name: 'Releasing a RC'
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=8192
steps:
- uses: actions/checkout@v3
with:
ref: master
token: ${{secrets.YARNBOT_TOKEN}}
- name: 'Retrieve all the relevant tags'
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: 'Use Node.js ${{ env.node-version }}'
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: 'Build a binary for convenience'
run: |
yarn build:cli
TMPBIN=$(mktemp -d)
cp ./packages/yarnpkg-cli/bundles/yarn.js $TMPBIN/yarn.js
grep -v "yarnPath:" .yarnrc.yml > $TMPBIN/.yarnrc.yml
cp $TMPBIN/.yarnrc.yml .yarnrc.yml
echo "yarnPath: '$TMPBIN/yarn.js'" >> .yarnrc.yml
git update-index --skip-worktree -- .yarnrc.yml
- name: 'Generate the release commits'
if: ${{fromJSON(github.event.inputs.apply_versions)}}
run: |
git config user.name "Yarn Bot"
git config user.email nison.mael+yarnbot@gmail.com
./scripts/release/01-release-tags.sh --prerelease
git push --follow-tags
- name: 'Upload the releases'
run: |
yarn config set -H 'npmAuthToken' "${{secrets.YARNBOT_NPM_TOKEN}}"
yarn config set -H 'npmRegistries["//npm.pkg.github.com"].npmAuthToken' "${{secrets.YARNBOT_TOKEN}}"
./scripts/release/02-release-builds.sh
./scripts/release/03-release-npm.sh
|