Skip to content

chore(build): update build_deb.sh #9

chore(build): update build_deb.sh

chore(build): update build_deb.sh #9

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
tag:
description: The tag to publish
required: true
push:
tags: [ 'v*.*.*' ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-linux-android # 64-bit ARM
- armv7-linux-androideabi # 32-bit ARM
- i686-linux-android # 32-bit x86
- x86_64-linux-android # 64-bit x86
- arm-linux-androideabi # 32-bit ARM (older ABI)
- thumbv7neon-linux-androideabi # 32-bit ARM with NEON
name: Build Release - ${{ matrix.target }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Set version variable
run: |
version="${{ github.event.inputs.tag || github.ref }}"
version=${version#v}
echo "$version"
- name: Set arch variable
run: |
arch_alias() {
case $1 in
"aarch64-linux-android")
echo "aarch64"
;;
"i686-linux-android")
echo "i686"
;;
"x86_64-linux-android")
echo "x86_64"
;;
"arm-linux-androideabi")
echo "arm"
;;
*)
echo "Invalid architecture name"
;;
esac
}
arch=$(arch_alias ${{ matrix.target }})
echo "$arch"
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Deps & Bins
uses: Swatinem/rust-cache@v2
- name: Install cross
shell: bash
run: |
if ! command -v cross &> /dev/null; then
echo "cross not found, installing..."
cargo install cross --git https://github.com/cross-rs/cross
else
echo "cross already installed, skipping installation."
fi
- name: Build - ${{ matrix.target }}
shell: bash
run: cross build --target=${{ matrix.target }} --release
- name: Install termux-create-package
run: pip3 install git+https://github.com/termux/termux-create-package
- name: Build Termux deb package
shell: bash
run: ./build_deb.sh -v ${version} -a ${arch}
- name: Upload Termux deb package artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ./deb/termux-clock_${version}_${arch}.deb
publish:
name: Publish to GitHub Releases
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
strategy:
matrix:
target:
- aarch64-linux-android # 64-bit ARM
- armv7-linux-androideabi # 32-bit ARM
- i686-linux-android # 32-bit x86
- x86_64-linux-android # 64-bit x86
- arm-linux-androideabi # 32-bit ARM (older ABI)
- thumbv7neon-linux-androideabi # 32-bit ARM with NEON
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag || github.ref }} # Ensure it checks out the correct tag
- name: Download Termux package artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.target }}
- name: Publish release
uses: ghalactic/github-release-from-tag@v5
with:
generateReleaseNotes: true
assets: |
- path: *.deb