Release: 3.0.0-alpha.15 #76
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 | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Set up credentials | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Install dependencies | |
run: npm clean-install | |
- name: Checkout to production | |
run: git checkout -B production | |
- name: Update version | |
run: | | |
echo "${{ github.event.release.tag_name }}" > version | |
git add -f version | |
- name: Run build | |
run: npm run-script build | |
- name: Add dist directory | |
run: git add -f dist | |
- name: Commit files | |
run: | | |
git commit -m "Release: ${{ github.event.release.tag_name }}" | echo | |
# We need to change the tag, so that it points to the newest build. | |
# Since that's how we do cache busting on cdn | |
- name: Change tag | |
run: | | |
RELEASE_TITLE=$(gh release view "${{ github.event.release.tag_name }}" --json name --template "{{.name}}") | |
RELEASE_DESC=$(gh release view "${{ github.event.release.tag_name }}" --json body --template "{{.body}}") | |
git tag -f -a "${{ github.event.release.tag_name }}" -m "$RELEASE_TITLE" -m "$RELEASE_DESC" | |
env: | |
GITHUB_USER: <ORG> | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push changes | |
run: | | |
git push --set-upstream origin production --force | |
git push origin "${{ github.event.release.tag_name }}" --force |