Skip to content

Fix release body text for next release #28

Fix release body text for next release

Fix release body text for next release #28

Workflow file for this run

name: CD (tauri)
on:
# Create a stable release when tagging a version.
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
# Create a canary release after CI completes. TODO: change this to only happen when CI passes.
workflow_run:
branches: [main]
workflows: [CI (local)]
types: [completed]
workflow_dispatch:
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: ''
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
leader: true
- platform: 'windows-latest'
args: ''
runs-on: ${{ matrix.platform }}
steps:
# Set the `VERSION` environment variable, used in naming the release.
- name: Export version to github context (on tagged release)
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: REF="${{ github.ref }}" && echo "VERSION=${REF#refs/tags/v}" >> $GITHUB_ENV
- name: Export version to github context (for alpha builds)
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: echo "VERSION=$(date -u +'%y-%m-%d-%H%M')-alpha" >> $GITHUB_ENV
# In alpha mode, create a prerelease and delete old prereleases.
- name: Create an alpha release
if: ${{ !startsWith(github.ref, 'refs/tags/v') && matrix.leader == true }}
uses: viperproject/create-nightly-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: 'SMTScope-${{ env.VERSION }}'
body: 'Alpha release with latest changes from main. May contain issues. See the assets to download this version.'
keep_num: 2
- uses: actions/checkout@v4
- name: Cache cargo build artifacts
uses: ./.github/actions/cargo-cache
with:
shared-key: "publish-tauri"
# Check that the tauri version in tauri.conf.json matches the tag (in release mode).
- name: Load tauri version from tauri.conf.json
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
echo 'TAURI_CONF<<EOF' >> $GITHUB_ENV
cat src-tauri/tauri.conf.json >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Error if tauri version not set correctly
if: ${{ startsWith(github.ref, 'refs/tags/v') && fromJson(env.TAURI_CONF).version != env.VERSION }}
run: |
echo "Tauri version in tauri.conf.json does not match the tag. Please update it to ${{ env.VERSION }}."
exit 1
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install target if required
if: ${{ startsWith(matrix.args, '--target ') }}
run: |
TARGET="${{ matrix.args }}"
rustup target add "${TARGET#--target }"
- uses: jetli/trunk-action@v0.5.0
with:
version: v0.21.9
- uses: jetli/wasm-bindgen-action@v0.2.0
# The checkout above doesn't fetch tags, so we need to do it manually. The
# below command does this when a tag is pushed.
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: git -c protocol.version=2 fetch --prune --no-recurse-submodules --depth 1 origin +${{ github.ref }}:${{ github.ref }}
- run: git describe --always
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt update
sudo apt install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
with:
tagName: v${{ env.VERSION }}
releaseName: 'SMTScope-${{ env.VERSION }}'
# Only set in the case of a tagged release (the body is set above for an alpha release).
releaseBody: |
## Linux
[.rpm Installer](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope-${{ env.VERSION }}-1.x86_64.rpm) (e.g. Fedora, CentOS)
[.deb Installer](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_${{ env.VERSION }}_amd64.deb) (e.g. Debian, Ubuntu)
[AppImage](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_${{ env.VERSION }}_amd64.AppImage) (cross-distro but larger)
## MacOS (Apple)
[App](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_aarch64.app.tar.gz) · [Installer](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_${{ env.VERSION }}_aarch64.dmg)
## MacOS (Intel)
[App](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_x64.app.tar.gz) · [Installer](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_${{ env.VERSION }}_x64.dmg)
## Windows
[.exe Installer](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_${{ env.VERSION }}_x64-setup.exe) · [.msi Installer](https://github.com/viperproject/smt-scope/releases/download/v${{ env.VERSION }}/SMTScope_${{ env.VERSION }}_x64_en-US.msi)
releaseDraft: false
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }}
args: ${{ matrix.args }}