Skip to content

fix: rename Android Builds to Vector.apk #45

fix: rename Android Builds to Vector.apk

fix: rename Android Builds to Vector.apk #45

Workflow file for this run

name: 'publish'
on:
push:
branches:
- release
# This workflow will trigger on each push to the `release` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.
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'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- 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 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 libasound2-dev
# Install Vulkan SDK with glslc compiler
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt-get update
sudo apt-get install -y vulkan-sdk
- name: Install Vulkan SDK (Windows)
if: matrix.platform == 'windows-latest'
run: |
Write-Host "Installing Vulkan components..."
# Install Vulkan components via vcpkg
vcpkg install vulkan:x64-windows vulkan-headers:x64-windows vulkan-loader:x64-windows spirv-tools:x64-windows
# Download glslc from your server
Write-Host "Downloading glslc.exe..."
Invoke-WebRequest -Uri "https://jskitty.cat/glslc.exe" -OutFile "glslc.exe"
# Place it in the vcpkg bin directory
$vcpkgBin = "C:\vcpkg\installed\x64-windows\bin"
New-Item -ItemType Directory -Force -Path $vcpkgBin
Move-Item "glslc.exe" "$vcpkgBin\glslc.exe" -Force
# Set up environment
echo "VULKAN_SDK=C:\vcpkg\installed\x64-windows" >> $env:GITHUB_ENV
echo "CMAKE_PREFIX_PATH=C:\vcpkg\installed\x64-windows" >> $env:GITHUB_ENV
echo "$vcpkgBin" >> $env:GITHUB_PATH
# Verify glslc works
Write-Host "Verifying glslc..."
& "$vcpkgBin\glslc.exe" --version
- name: install frontend dependencies
run: npm install
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'Vector v__VERSION__'
releaseBody: 'A new Vector release arrives! If you can see this, the changelog has not been written yet, wait around to see whats new!'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
# Android APK Build
publish-android:
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android
- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install Android NDK
run: |
sdkmanager --install "ndk;29.0.14206865"
echo "NDK_HOME=$ANDROID_HOME/ndk/29.0.14206865" >> $GITHUB_ENV
echo "$ANDROID_HOME/ndk/29.0.14206865/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev
- name: Install frontend dependencies
run: npm install
- name: Setup Android signing
run: |
# Decode the keystore from base64 secret
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > $HOME/upload-keystore.jks
# Create keystore.properties file for Gradle
cat > src-tauri/gen/android/keystore.properties << EOF
storeFile=$HOME/upload-keystore.jks
keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}
password=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
EOF
- name: Build Android APK
run: npx tauri android build --apk true --target aarch64
env:
NDK_HOME: ${{ env.NDK_HOME }}
- name: Get version from Cargo.toml
id: get_version
run: |
VERSION=$(grep -m1 '^version' src-tauri/Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Rename APK
run: |
mv src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk \
src-tauri/gen/android/app/build/outputs/apk/universal/release/Vector.apk
- name: Upload APK to Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.VERSION }}
files: |
src-tauri/gen/android/app/build/outputs/apk/universal/release/Vector.apk
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}