Skip to content

chore(release): 1.21.0 #55

chore(release): 1.21.0

chore(release): 1.21.0 #55

Workflow file for this run

name: release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Setup node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 26.x
package-manager-cache: false
- name: Write ffalt.github.io app config
run: |
echo "{\"url\": \"https://ffalt.github.io/mah/\", \"name\": \"Mah\", \"title\": \"Mah - Mahjong\", \"category\": \"A Mahjong Solitaire Board Game\", \"description\": \"The original open source version of many Mahjong games out there. Completely free, no ads, no tracking.\", \"kyodai\":true, \"editor\":true}" > custom-build-config.json
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test
- name: Build GH Pages release
run: npm run build:deploy-ghpages
- name: Build GH Pages settings
run: touch ./dist/.nojekyll
- name: Deploy to GH Pages branch 🚀
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
branch: gh-pages
folder: dist
clean: true
- name: Write release app config
run: |
echo "{\"name\": \"Mah\"}" > custom-build-config.json
- name: Build
run: npm run build:deploy-release
- name: Compute version and zip name
id: version
run: |
RAW=${GITHUB_REF_NAME}
VERSION=${RAW#v}
SAFE=${VERSION//./_}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "zip=webapp-mah-$SAFE.zip" >> $GITHUB_OUTPUT
- name: Create release package
env:
ZIP_NAME: ${{ steps.version.outputs.zip }}
run: cd dist && zip -r "./$ZIP_NAME" .
- name: Generate Releaselog
run: |
npm run build:releaselog
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZIP_NAME: ${{ steps.version.outputs.zip }}
run: |
gh release create "$GITHUB_REF_NAME" \
--title "Release $GITHUB_REF_NAME" \
--notes-file ./RELEASELOG.md \
--latest \
"./dist/$ZIP_NAME"