Skip to content

bug fix

bug fix #78

Workflow file for this run

name: Build mtc-artillery-overlay
on:
push:
branches:
- release
workflow_dispatch:
jobs:
version_check:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- uses: ari-party/action-get-latest-tag@v1
id: tag_version
- name: Get Tauri version
id: tauri_version
run: |
tauri_version=$(node packages/mtc-artillery-overlay/scripts/version.mjs)
echo "tauri_version=$tauri_version" >> $GITHUB_OUTPUT
- name: Compare
run: |
raw_version=${{ steps.tag_version.outputs.tag }}
prefixedVersion=${raw_version#overlay-}
version=${prefixedVersion#v}
tauri_version=${{ steps.tauri_version.outputs.tauri_version }}
echo "Branch version: $version"
echo "Tauri version: $tauri_version"
if [ "$version" == "$tauri_version" ]; then
echo "Versions are equal, exiting..."
exit 1
fi
build:
needs: 'version_check'
permissions:
contents: write
id-token: write
attestations: write
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'windows-latest'
args: ''
- platform: 'ubuntu-20.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
working-directory: ./packages/mtc-artillery-overlay
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install pnpm packages
run: pnpm install
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install dependencies (ubuntu)
if: matrix.platform == 'ubuntu-20.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
- name: Get workflow run URL
id: workflow_url
run: |
url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
echo "url=$url" >> $GITHUB_OUTPUT
- uses: tauri-apps/tauri-action@v0
id: tauri_build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: overlay-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'Overlay v__VERSION__'
releaseBody: |
View the workflow summary [here](${{ steps.workflow_url.outputs.url }}).
See the assets to download this version and install.
```
aarch64.dmg = apple
amd64.appimage = linux
amd64.deb = linux
x64-setup.exe = windows
x64.dmg = apple
x64_en-US.msi = windows
```
releaseDraft: true
prerelease: false
projectPath: ./packages/mtc-artillery-overlay
args: ${{ matrix.args }}
- name: Convert artifact paths
id: artifact_paths
run: |
json='${{ steps.tauri_build.outputs.artifactPaths }}' # must use single quotes
list="$(echo $json | jq -r '. | join(", ")')"
echo "list=$list" >> $GITHUB_OUTPUT
- uses: actions/attest-build-provenance@v1
with:
subject-path: ${{ steps.artifact_paths.outputs.list }}