clash/.github/workflows/release.yml
2025-05-15 09:27:51 +02:00

37 lines
1.2 KiB
YAML

name: Release
on:
release:
types: [ published ]
env:
node_version: 14
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
with:
experimental: 'true' # to get lock file support
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
registry-url: "https://registry.npmjs.org"
- name: Set Release Version from Tag
run: echo "RELEASE_VERSION=$(echo ${{github.ref_name}} | sed s/v//g)" >> $GITHUB_ENV
- name: Publish Server
# see https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: |
./scripts/publish-server.sh ${{ env.RELEASE_VERSION }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Client
# rustup target add wasm32-unknown-unknown # automatically done by wasm-pack
run: |
./scripts/publish-client.sh ${{ env.RELEASE_VERSION }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}