mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-04-26 10:51:24 +00:00
* chore: bump version to 0.6.0-beta.3 * chore: enable push * feat: artifact version replace, release script protections * Update scripts/release.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fix: console log * feat: release script bumping --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
204 lines
6.8 KiB
YAML
204 lines
6.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+.[0-9]+.[0-9]+' # Stable releases only (v1.0.0)
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version tag (e.g., v0.1.0)'
|
|
required: true
|
|
default: 'v0.1.0'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-desktop:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: ubuntu-22.04
|
|
target: x86_64-unknown-linux-gnu
|
|
artifact_name: linux
|
|
- platform: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
artifact_name: windows
|
|
- platform: macos-latest
|
|
target: x86_64-apple-darwin
|
|
artifact_name: macos-intel
|
|
- platform: macos-latest
|
|
target: aarch64-apple-darwin
|
|
artifact_name: macos-arm
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Install Linux dependencies
|
|
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
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Get clean version
|
|
id: get_version
|
|
shell: bash
|
|
run: |
|
|
VERSION="${{ github.ref_name }}"
|
|
# Remove 'v' prefix and strip anything after '-'
|
|
CLEAN=$(echo $VERSION | sed 's/^v//' | cut -d'-' -f1)
|
|
echo "clean_version=$CLEAN" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build Tauri app
|
|
shell: bash
|
|
env:
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
run: |
|
|
npx tauri build --target ${{ matrix.target }} --config '{"version":"${{ steps.get_version.outputs.clean_version }}"}'
|
|
|
|
- name: Rename artifacts
|
|
shell: bash
|
|
run: |
|
|
VERSION_CLEAN="${{ steps.get_version.outputs.clean_version }}"
|
|
VERSION_FULL=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
|
if [ "$VERSION_CLEAN" != "$VERSION_FULL" ]; then
|
|
echo "Renaming artifacts from $VERSION_CLEAN to $VERSION_FULL"
|
|
find src-tauri/target/${{ matrix.target }}/release/bundle -type f -name "*$VERSION_CLEAN*" | while read f; do
|
|
NEW_F="${f//$VERSION_CLEAN/$VERSION_FULL}"
|
|
echo "Moving $f to $NEW_F"
|
|
mv "$f" "$NEW_F"
|
|
done
|
|
fi
|
|
|
|
- name: Upload to Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tagName: ${{ github.ref_name }}
|
|
releaseName: 'Aventura ${{ github.ref_name }}'
|
|
body: 'See the assets to download and install this version.'
|
|
draft: true
|
|
prerelease: false
|
|
files: |
|
|
src-tauri/target/${{ matrix.target }}/release/bundle/**/*.msi
|
|
src-tauri/target/${{ matrix.target }}/release/bundle/**/*.exe
|
|
src-tauri/target/${{ matrix.target }}/release/bundle/**/*.AppImage
|
|
src-tauri/target/${{ matrix.target }}/release/bundle/**/*.deb
|
|
src-tauri/target/${{ matrix.target }}/release/bundle/**/*.rpm
|
|
src-tauri/target/${{ matrix.target }}/release/bundle/**/*.dmg
|
|
src-tauri/target/${{ matrix.target }}/release/bundle/**/*.sig
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-android:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: Setup Android NDK
|
|
uses: nttld/setup-ndk@v1
|
|
id: setup-ndk
|
|
with:
|
|
ndk-version: r27
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Initialize Android
|
|
env:
|
|
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
run: npx tauri android init
|
|
|
|
- name: Add Android permissions
|
|
run: |
|
|
MANIFEST="src-tauri/gen/android/app/src/main/AndroidManifest.xml"
|
|
# Add camera permission for QR code scanning
|
|
sed -i 's|<uses-permission android:name="android.permission.INTERNET" />|<uses-permission android:name="android.permission.INTERNET" />\n <!-- Camera permission for QR code scanning -->\n <uses-permission android:name="android.permission.CAMERA" />\n <uses-feature android:name="android.hardware.camera" android:required="false" />\n <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />|' "$MANIFEST"
|
|
|
|
- name: Generate app icons
|
|
run: npx tauri icon sun2022.png
|
|
|
|
- name: Build Android APK
|
|
env:
|
|
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
run: npx tauri android build
|
|
|
|
- name: Decode keystore
|
|
env:
|
|
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
|
run: |
|
|
echo "$KEYSTORE_BASE64" | base64 -d > aventura-release.keystore
|
|
|
|
- name: Sign APK
|
|
env:
|
|
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
|
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
|
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
|
run: |
|
|
$ANDROID_HOME/build-tools/34.0.0/apksigner sign \
|
|
--ks aventura-release.keystore \
|
|
--ks-key-alias "$KEY_ALIAS" \
|
|
--ks-pass pass:"$KEYSTORE_PASSWORD" \
|
|
--key-pass pass:"$KEY_PASSWORD" \
|
|
--out aventura-release.apk \
|
|
src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk
|
|
|
|
- name: Upload Android APK
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: android-apk
|
|
path: aventura-release.apk
|
|
|
|
- name: Upload to Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
files: aventura-release.apk
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|