Skip to content
Closed

1111 #22

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 96 additions & 65 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,96 @@
name: Android Build

on:
workflow_dispatch:
# push:
# branches:
# - 'main'

jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: gradle

- name: Set up Android SDK
uses: android-actions/setup-android@v3

- uses: pnpm/action-setup@v3
with:
version: latest

- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Init Project Config
run: |
pnpm install
pnpm pp:worker

- name: Grant Execute Permission for Gradle
run: chmod +x ./gradlew

- name: Build Debug APK
run: ./gradlew assembleDebug

- name: Rename APK file
run: |
cd app/build/outputs/apk/debug/
mv app-debug.apk ${{ env.NAME }}-v${{ env.VERSION }}.apk

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: app/build/outputs/apk/debug/*.apk
tag_name: '${{ env.NAME }}'
name: '${{ env.NAME }} v${{ env.VERSION }}'
body: '${{ env.PUBBODY }}'
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NAME: ${{ env.NAME }}
VERSION: ${{ env.VERSION }}
PUBBODY: ${{ env.PUBBODY }}
name: Release

on:
workflow_dispatch:
push:
tags:
- 'v*'
# branches:
# - 'main'

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
target: 'aarch64-apple-darwin'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
target: 'x86_64-apple-darwin'
args: '--target x86_64-apple-darwin'

- platform: 'ubuntu-22.04'
target: 'x86_64-unknown-linux-gnu'
args: ''
- platform: 'ubuntu-22.04'
target: 'aarch64-unknown-linux-gnu'
args: ''

- platform: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
args: ''
- platform: 'windows-latest'
target: 'aarch64-pc-windows-msvc'
args: '--target aarch64-pc-windows-msvc'

runs-on: ${{ matrix.platform }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- name: Check Tauri
if: env.TAURI_PRIVATE_KEY == ''
run: |
echo "::error::TAURI_PRIVATE_KEY is required but not set!"
exit 1

- name: Install rust target
run: rustup target add ${{ matrix.target }}

- uses: pnpm/action-setup@v3
with:
version: latest

- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install frontend dependencies
run: pnpm install # change this to npm, pnpm or bun depending on which one you use.

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Regenerate Icons
run: pnpm tauri icon

- name: Create Apple icon
if: matrix.platform == 'macos-latest'
run: node ./scripts/creatIcon.cjs

- 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

- uses: Sjj1024/tauri-zhaction@tauri-zhaciton
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: 'PakePlus'
releaseName: 'PakePlus v__VERSION__'
releaseBody: 'This is a workflow to help you automate the publishing of your PakePlus project to GitHub Packages.'
releaseDraft: false
prerelease: false
publish: true
args: ${{ matrix.args }}
renameArtifacts: 'PakePlus'