Release #20
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: | |
push: | |
tags: | |
- "v*.*.*" | |
workflow_dispatch: | |
jobs: | |
build-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Zip font files | |
run: | | |
zip -r font.zip font | |
- name: Extract version from tag | |
run: | | |
VERSION=$(echo ${GITHUB_REF} | sed 's/refs\/tags\///') | |
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV | |
- name: Get Changelog | |
run: | | |
{ | |
echo 'RELEASE_NOTES<<EOF' | |
grep -A 1000 "^# \[$VERSION\]" CHANGELOG.md | sed '1d;/^# \[/,$d' | |
echo 'EOF' | |
} >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: ${{ env.RELEASE_NOTES }} | |
files: | | |
styles.css | |
font.zip | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
build-site: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install rust with wasm | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rust-src | |
target: wasm32-unknown-unknown | |
- name: Install Binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Install trunk | |
run: "cargo binstall --no-confirm trunk" | |
- name: Build website | |
run: "cd site && trunk build" | |
- name: Upload site artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload entire repository | |
path: 'site/dist/' | |
deploy-site: | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Add a dependency to the build job | |
needs: build-site | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
id-token: write # to verify the deployment originates from an appropriate source | |
pages: write # to deploy to Pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v3 |