Skip to content

Commit

Permalink
chore: try to fix release CI with new action
Browse files Browse the repository at this point in the history
  • Loading branch information
trobonox committed Jun 12, 2024
1 parent 4485e1a commit 1a53547
Showing 1 changed file with 37 additions and 70 deletions.
107 changes: 37 additions & 70 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,94 +14,61 @@ concurrency:
cancel-in-progress: true

jobs:
build-binaries:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-22.04
rust_target: x86_64-unknown-linux-gnu
- os: macos-13
rust_target: x86_64-apple-darwin
- os: macos-latest
rust_target: aarch64-apple-darwin
- os: windows-latest
rust_target: x86_64-pc-windows-msvc


runs-on: ${{ matrix.platform.os }}
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
args: ""
- platform: "windows-latest"
args: ""

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4

- name: Output info
run: echo ${{ matrix.platform.os }} ${{ matrix.platform.rust_target }}
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*

- name: 'Setup Rust'
uses: actions-rs/toolchain@v1
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
default: true
override: true
profile: minimal
toolchain: stable
target: ${{ matrix.platform.rust_target }}
# 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' || '' }}

- uses: Swatinem/rust-cache@v2

- name: install dependencies (ubuntu x86_64)
if: matrix.platform.os == 'ubuntu-22.04'
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Build Frontend
run: yarn && yarn generate
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-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: Install Tauri CLI
if: matrix.platform.rust_target == 'aarch64-apple-darwin'
run: yarn add @tauri-apps/cli-darwin-arm64
- name: install frontend dependencies
run: yarn install # change this to npm, pnpm or bun depending on which one you use.

- uses: JonasKruckenberg/[email protected]
id: tauri_build
with:
target: ${{ matrix.platform.rust_target }}

# The `artifacts` output can now be used by a different action to upload the artifacts
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"

publish:
needs: build-binaries
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
# Download the previously uploaded artifacts
- uses: actions/download-artifact@v4
id: download
with:
name: artifacts
path: artifacts
# And create a release with the artifacts attached
- name: 'create release'
uses: softprops/action-gh-release@master
id: release
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: "Kanri vx.x.x"
draft: true
files: ./artifacts/**/*
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: "App v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}

publish-kanri-arm:
needs: publish
needs: publish-tauri
strategy:
matrix:
arch: [arm64, armv7]
Expand All @@ -122,5 +89,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.publish.outputs.upload_url }}
upload_url: ${{ needs.publish-tauri.outputs.releaseHtmlUrl }}
targets: ./src-tauri/target/*/release/bundle/deb/*.deb

0 comments on commit 1a53547

Please sign in to comment.