Skip to content

release-build

release-build #3

Workflow file for this run

name: release-build
on:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Cache NDK
id: cache-ndk
uses: actions/cache@v4
with:
path: ~/ndk_temp
key: ndk-${{ runner.os }}-ndk_temp
- name: Setup ndk
if: steps.cache-ndk.outputs.cache-hit != 'true'
run: |
ndk_url=$(wget -qO- https://github.com/android/ndk/releases/latest | grep -e 'https://dl.google.com/android/repository/android-ndk-.*-linux.zip' | sed -n 's/.*<a href="\([^"]*\)".*/\1/p')
wget -O ndk.zip $ndk_url -nv
mkdir -p ~/ndk_temp
unzip ndk.zip -d ~/ndk_temp 2>&1 > /dev/null
mv ~/ndk_temp/*/* ~/ndk_temp
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: aarch64-linux-android
components: rust-src
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y gcc-multilib
cargo install cargo-ndk --locked
- name: Setup Webui deps
run: |
cd webui/
npm install
- name: Build
run: |
export ANDROID_NDK_HOME=$(realpath ~/ndk_temp)
export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME
cargo xtask b
- name: Prepare artifacts
run: |
mkdir -p output/artifact/
unzip "output/magic_mount_rs.zip" -d output/artifact/
- name: Upload release version
uses: actions/upload-artifact@v4
with:
name: meta-mm
compression-level: 9
path: output/artifact/
- name: Install git-cliff
run: |
curl -sSL https://github.com/orhun/git-cliff/releases/download/v2.10.1/git-cliff-2.10.1-x86_64-unknown-linux-gnu.tar.gz -o git-cliff.tar.gz
tar -xf git-cliff.tar.gz
sudo mv git-cliff-2.10.1/git-cliff /usr/local/bin/
- name: Generate Changelog
run: |
PROP_FILE="module/module.prop"
VERSION=$(grep "^version=" "$PROP_FILE" | cut -d= -f2 | sed 's/-.*//')
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
git-cliff "$PREV_TAG"..HEAD --tag "v$VERSION" -o /tmp/changelog.md
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: false
prerelease: false
files: output/*.zip
body_path: /tmp/changelog.md