feat: update Rust setup in release workflow to use actions/setup-rust #6
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: 'Release' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- dev | |
jobs: | |
publish-tauri: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: 'ubuntu-22.04' | |
android: true | |
args: '--apk --config crates/seminar-assess-tauri/tauri.conf.release.json' | |
mobile: true | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'pnpm' # Set this to npm, yarn or pnpm. | |
- name: Setup Rust nightly | |
uses: actions/setup-rust@v1 | |
with: | |
rust-toolchain: true | |
targets: | | |
${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
${{ matrix.platform == 'ubuntu-22.04' && 'aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android' || '' }} | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: './target' | |
- name: Setup Java (Android only) | |
if: matrix.mobile | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Android SDK (Android only) | |
if: matrix.mobile | |
uses: android-actions/setup-android@v3 | |
- name: Install NDK (Android only) | |
if: matrix.mobile | |
run: sdkmanager "ndk;27.0.11902837" | |
- name: setup Android signing (Android only) | |
if: matrix.mobile | |
run: | | |
cd crates/seminar-assess-tauri/gen/android | |
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties | |
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties | |
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks | |
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties | |
- name: install frontend dependencies | |
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too. | |
run: pnpm install # change this to npm or pnpm depending on which one you use. | |
- uses: tauri-apps/tauri-action@3c20edcd47f6c6fa6d7bd17d279e1c1b454ff57d | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837 | |
with: | |
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version. | |
releaseName: 'v__VERSION__' | |
releaseBody: 'See the assets to download this version and install.' | |
releaseDraft: true | |
prerelease: false | |
includeRelease: ${{ !(matrix.ios || matrix.android) }} | |
includeAndroid: ${{ matrix.mobile || false }} | |
args: ${{ matrix.args }} |