minimize button #96
This file contains 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: Build overlay | |
on: | |
push: | |
branches: | |
- release | |
paths: | |
- packages/overlay/** | |
workflow_dispatch: | |
jobs: | |
version_check: | |
runs-on: "ubuntu-latest" | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./packages/overlay | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: 9 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
cache-dependency-path: ./packages/overlay/pnpm-lock.yaml | |
- name: Install pnpm packages | |
run: pnpm install | |
- uses: ari-party/action-get-latest-tag@v1 | |
id: tag_version | |
- name: Get Tauri version | |
id: tauri_version | |
run: | | |
tauri_version=$(node 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/overlay | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: 9 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
cache-dependency-path: ./packages/overlay/pnpm-lock.yaml | |
- 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. | |
``` | |
x86_64.rpm = linux | |
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/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 }} |