mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +00:00
ci: streamline release workflow
This commit is contained in:
parent
cbe2234ad4
commit
5a8bd5e79e
71
.github/workflows/release.yml
vendored
71
.github/workflows/release.yml
vendored
@ -1,47 +1,16 @@
|
|||||||
name: Release
|
name: Build and Release OpenWRT Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- "v*"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-ipk:
|
build:
|
||||||
runs-on: ubuntu-latest
|
name: Build ${{ matrix.arch }} on ${{ matrix.version }}
|
||||||
|
|
||||||
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
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -50,48 +19,46 @@ jobs:
|
|||||||
- x86_64
|
- x86_64
|
||||||
- aarch64_generic
|
- aarch64_generic
|
||||||
- arm_cortex-a7_neon-vfpv4
|
- arm_cortex-a7_neon-vfpv4
|
||||||
|
- arm_cortex-a9_vfpv3-d16
|
||||||
- arm_cortex-a15_neon-vfpv4
|
- arm_cortex-a15_neon-vfpv4
|
||||||
- mips_24kc
|
- mips_24kc
|
||||||
- mipsel_24kc
|
- mipsel_24kc
|
||||||
|
version:
|
||||||
|
- 24.10.0
|
||||||
|
- main
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v5
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Build APK
|
- name: Build
|
||||||
uses: openwrt/gh-action-sdk@v9
|
uses: openwrt/gh-action-sdk@v9
|
||||||
env:
|
env:
|
||||||
ARCH: ${{ matrix.arch }}
|
ARCH: ${{ matrix.arch }}
|
||||||
FEEDNAME: ua3f_ci
|
FEEDNAME: ua3f_ci
|
||||||
PACKAGES: openwrt
|
PACKAGES: openwrt
|
||||||
|
|
||||||
- name: Rename APK with arch suffix
|
- name: Rename packages with arch suffix
|
||||||
run: |
|
run: |
|
||||||
cd bin/packages/${{ matrix.arch }}/ua3f_ci/
|
cd bin/packages/${{ matrix.arch }}/ua3f_ci/
|
||||||
|
for f in *.ipk; do mv "$f" "${f/.ipk/-${{ matrix.arch }}.ipk}" 2>/dev/null || true; done
|
||||||
for f in *.apk; do mv "$f" "${f/.apk/-${{ matrix.arch }}.apk}" 2>/dev/null || true; done
|
for f in *.apk; do mv "$f" "${f/.apk/-${{ matrix.arch }}.apk}" 2>/dev/null || true; done
|
||||||
|
|
||||||
- name: Upload APK artifacts
|
- name: Upload packages
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: apk-packages-${{ matrix.arch }}
|
name: packages-${{ matrix.arch }}
|
||||||
path: bin/packages/${{ matrix.arch }}/ua3f_ci/*.apk
|
path: bin/packages/${{ matrix.arch }}/ua3f_ci/*.*pk
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build-ipk, build-apk]
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download IPK artifacts
|
- name: Download packages
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ipk-packages
|
pattern: packages-*
|
||||||
path: dist/
|
|
||||||
|
|
||||||
- name: Download APK artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: apk-packages-*
|
|
||||||
path: dist/
|
path: dist/
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
@ -99,7 +66,7 @@ jobs:
|
|||||||
id: get_version
|
id: get_version
|
||||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
if: github.ref_type == 'tag'
|
if: github.ref_type == 'tag'
|
||||||
with:
|
with:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user