Skip to content

Commit

Permalink
ci: changed tauri-build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mon4ik committed Jul 20, 2024
1 parent e3b5074 commit cfd70bc
Showing 1 changed file with 76 additions and 48 deletions.
124 changes: 76 additions & 48 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,66 +6,94 @@ on:
- "v*"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish-tauri:
permissions:
contents: write
build-binaries:
strategy:
fail-fast: false
matrix:
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-20.04'
args: ''
- platform: 'windows-latest'
args: ''
platform:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
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 }}
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: install dependencies (ubuntu only)
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 libappindicator3-dev librsvg2-dev patchelf
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false
- name: setup node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'pnpm'

- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'

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

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- uses: Swatinem/rust-cache@v2

- name: install frontend dependencies
run: pnpm install
- name: install dependencies (ubuntu only)
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- uses: tauri-apps/tauri-action@v0
- name: install frontend dependencies
run: pnpm install

- uses: JonasKruckenberg/tauri-build@v1.2.2
id: tauri_build
with:
target: ${{ matrix.platform.rust_target }}

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

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

0 comments on commit cfd70bc

Please sign in to comment.