Release #7
This file contains hidden or 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: | |
| inputs: | |
| version: | |
| description: 'Version to release (e.g. 1.3.0 or 1.3.0-beta.0)' | |
| required: true | |
| type: string | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout tag | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: v${{ inputs.version }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Upgrade npm | |
| run: npm install -g npm@latest | |
| - name: Install deps | |
| run: npm ci --audit=false | |
| - name: Install client deps | |
| run: npm ci --audit=false | |
| working-directory: client | |
| - name: Publish client to npm | |
| run: npm publish --provenance --access public | |
| working-directory: client | |
| publish-docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Checkout tag | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: v${{ inputs.version }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker meta | |
| id: docker_meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}},value=${{ inputs.version }} | |
| type=semver,pattern={{major}}.{{minor}},value=${{ inputs.version }} | |
| type=semver,pattern={{major}},value=${{ inputs.version }} | |
| type=raw,value=latest,enable=${{ !contains(inputs.version, '-') }} | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build/Tag/Push Image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ steps.docker_meta.outputs.tags }} | |
| labels: ${{ steps.docker_meta.outputs.labels }} | |
| push: true | |
| github-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout tag | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: v${{ inputs.version }} | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PRERELEASE_FLAG="" | |
| if echo "${{ inputs.version }}" | grep -q "-"; then | |
| PRERELEASE_FLAG="--prerelease" | |
| fi | |
| gh release create "v${{ inputs.version }}" \ | |
| --generate-notes \ | |
| $PRERELEASE_FLAG |