Release #26
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 | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.RELEASE_BOT_ID }} | |
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
- name: Release | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
run: | | |
set -e | |
echo "Checkout the release branch" | |
git fetch && git checkout releases/v1 | |
echo "Bring latest changes from main" | |
git reset --hard origin/main | |
echo "Install dependencies" | |
npm install | |
echo "run build script" | |
npm run build | |
echo "Set global git config" | |
git config --global user.name 'Release Bot' | |
git config --global user.email '[email protected]' | |
echo "Commit changes" | |
git add dist/ | |
git commit -m "Release v1" | |
echo "Force push to overwrite any previous commits for this branch" | |
git push -f origin releases/v1 | |
echo "Remove previously pushed tags (v1 will be unusable momentarily until you re-push)" | |
git push origin :refs/tags/v1 | |
echo "Re-apply the tag" | |
git tag -fa v1 -m "v1" | |
echo "Push everything" | |
git push origin v1 |