Update publish.yml #18
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: "publish" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish-tauri: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: "macos-latest" # for Arm-based Macs (M1 and above). | |
args: "--target aarch64-apple-darwin" | |
arch: "aarch64" | |
ext: "dmg" | |
- platform: "macos-latest" # for Intel-based Macs. | |
args: "--target x86_64-apple-darwin" | |
arch: "x64" | |
ext: "dmg" | |
- platform: "ubuntu-22.04" # for Ubuntu (Tauri v2) | |
args: "--target x86_64-unknown-linux-gnu" | |
arch: "x64" | |
ext: "AppImage" | |
- platform: "windows-latest" # for Windows | |
args: "--target x86_64-pc-windows-msvc" | |
arch: "x64" | |
ext: "msi" | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: yarn | |
- name: install Rust stable and target | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.args }} | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: './src-tauri -> target' | |
- name: install dependencies (ubuntu only) | |
if: matrix.platform == 'ubuntu-22.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: install frontend dependencies | |
run: yarn install | |
- uses: tauri-apps/tauri-action@v0 | |
id: build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tagName: "app-v__VERSION__" # Automatically replaced with the app version from tauri.conf.json. | |
releaseName: "DTime v__VERSION__" # Automatically replaced with the app version. | |
releaseBody: "This is the official release of DTime version v__VERSION__." # Release notes with the app version. | |
releaseDraft: false # Set to true if you want to create a draft release. | |
prerelease: false # Set to true if this is a pre-release. | |
args: ${{ matrix.args }} | |
- name: Rename the bundle | |
run: | | |
mv "src-tauri/target/release/bundle/${{ matrix.ext }}/DTime.${{ matrix.ext }}" "src-tauri/target/release/bundle/${{ matrix.ext }}/DTime_${{ steps.build.outputs.version }}_${{ matrix.platform }}_${{ matrix.arch }}.${{ matrix.ext }}" | |
if: always() # Ensure it runs even if the build fails | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "DTime_${{ steps.build.outputs.version }}_${{ matrix.platform }}_${{ matrix.arch }}.${{ matrix.ext }}" | |
path: "src-tauri/target/release/bundle/${{ matrix.ext }}/DTime_${{ steps.build.outputs.version }}_${{ matrix.platform }}_${{ matrix.arch }}.${{ matrix.ext }}" |