UA3F/.github/workflows/release.yml
2025-11-19 16:34:52 +08:00

113 lines
2.6 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-ipk:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.21'
- name: Clone and build po2lmo
run: |
rm -rf po2lmo
git clone https://github.com/openwrt-dev/po2lmo.git po2lmo-build
cd po2lmo-build
make
sudo make install
- name: Build IPK binaries
run: |
chmod +x build.sh
./build.sh
- name: Upload IPK artifacts
uses: actions/upload-artifact@v4
with:
name: ipk-packages
path: dist/*
retention-days: 1
build-apk:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64_generic
- arm_cortex-a7_neon-vfpv4
- arm_cortex-a15_neon-vfpv4
- mips_24kc
- mipsel_24kc
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Build APK
uses: openwrt/gh-action-sdk@v9
env:
ARCH: ${{ matrix.arch }}
FEEDNAME: ua3f_ci
PACKAGES: openwrt
- name: Rename APK with arch suffix
run: |
cd bin/packages/${{ matrix.arch }}/ua3f_ci/
for f in *.apk; do mv "$f" "${f/.apk/-${{ matrix.arch }}.apk}" 2>/dev/null || true; done
- name: Upload APK artifacts
uses: actions/upload-artifact@v4
with:
name: apk-packages-${{ matrix.arch }}
path: bin/packages/${{ matrix.arch }}/ua3f_ci/*.apk
retention-days: 1
release:
needs: [build-ipk, build-apk]
runs-on: ubuntu-latest
steps:
- name: Download IPK artifacts
uses: actions/download-artifact@v4
with:
name: ipk-packages
path: dist/
- name: Download APK artifacts
uses: actions/download-artifact@v4
with:
pattern: apk-packages-*
path: dist/
merge-multiple: true
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
name: UA3F ${{ steps.get_version.outputs.VERSION }}
files: dist/*
draft: true
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}