update workflow
This commit is contained in:
parent
997bf44235
commit
f3411b658b
72
.github/workflows/main.yml
vendored
72
.github/workflows/main.yml
vendored
@ -2,45 +2,49 @@ name: "Auto compile with OpenWrt SDK"
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
paths:
|
tags:
|
||||||
- 'qmodem/luci/luci-app-qmodem/Makefile'
|
- 'v*'
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job_prepare:
|
job_prepare:
|
||||||
name: Prepare
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
git_tag: ${{ steps.set_git_tag.outputs.git_tag }}
|
branch_name: ${{ env.branch_name }}
|
||||||
is_latest: ${{ steps.cache-version.outputs.cache-hit }}
|
tag_name: ${{ env.tag_name }}
|
||||||
|
push_type: ${{ env.push_type }}
|
||||||
|
tag_message: ${{ env.tag_message }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Determine push type
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||||
|
echo "This is a tag push."
|
||||||
|
echo "tag_name=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "push_type=tag" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "This is a branch push."
|
||||||
|
echo "branch_name=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "push_type=branch" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
if:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
path: 'qmodem'
|
path: 'qmodem'
|
||||||
|
|
||||||
- name: Set git tag
|
- name: Get tag info
|
||||||
id: set_git_tag
|
id: get_tag_info
|
||||||
run: |
|
run: |
|
||||||
pkg_version=$(grep -oP '^PKG_VERSION:=\K.*' qmodem/luci/luci-app-qmodem/Makefile)
|
cd qmodem
|
||||||
if [ -z "$pkg_version" ]; then
|
TAG_MESSAGE=$(git for-each-ref refs/tags/${{ env.tag_name }} --format='%(contents)')
|
||||||
echo "PKG_VERSION not found in Makefile"
|
echo "tag_message=${TAG_MESSAGE}" >> $GITHUB_ENV
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Extracted PKG_VERSION: $pkg_version"
|
|
||||||
tag="v$pkg_version"
|
|
||||||
echo "git_tag=$tag" >> $GITHUB_OUTPUT
|
|
||||||
echo "git_tag=$tag"
|
|
||||||
echo "git_tag=$tag" >> cache-version
|
|
||||||
|
|
||||||
- name: Cache Version
|
|
||||||
id: cache-version
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: cache-version
|
|
||||||
key: qmodem-version
|
|
||||||
|
|
||||||
job_build_qmodem:
|
job_build_qmodem:
|
||||||
name: Build QModem
|
name: Build QModem
|
||||||
@ -48,7 +52,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
build_arch: ['arm64_ipk',"arm64_apk"]
|
build_arch: ['arm64_ipk',"arm64_apk","x64_apk","x64_ipk" ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
@ -156,23 +160,11 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Check Release type
|
|
||||||
run: |
|
|
||||||
if [[ "${GITHUB_REF}" == *"-beta" ]]; then
|
|
||||||
echo "Release type: beta"
|
|
||||||
echo "RELEASE_TYPE=beta" >> $GITHUB_ENV
|
|
||||||
elif [[ "${GITHUB_REF}" == *"-rc" ]]; then
|
|
||||||
echo "Release type: rc"
|
|
||||||
echo "RELEASE_TYPE=rc" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "Release type: release"
|
|
||||||
echo "RELEASE_TYPE=release" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
if: ${{ needs.job_prepare.outputs.is_latest == 'true' }}
|
if: ${{ needs.job_prepare.outputs.push_type == 'tag' }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ needs.job_prepare.outputs.git_tag }}
|
body: ${{ needs.job_prepare.outputs.tag_message }}
|
||||||
prerelease: false
|
tag_name: ${{ needs.job_prepare.outputs.tag_name }}
|
||||||
|
prerelease: ${{ needs.job_prepare.outputs.tag_name == '*-beta' || needs.job_prepare.outputs.tag_name == '*-rc' }}
|
||||||
files: releases/*
|
files: releases/*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
SDK_NAME=openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64
|
SDK_NAME=openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64
|
||||||
SDK_URL=https://downloads.openwrt.org/snapshots/targets/x86/64/
|
SDK_URL=https://downloads.openwrt.org/snapshots/targets/x86/64/
|
||||||
SDK_ARCH=x86_64
|
SDK_ARCH=x86_64
|
||||||
|
SDK_EXT=tar.zst
|
4
.github/workflows/x64_ipk.env
vendored
Normal file
4
.github/workflows/x64_ipk.env
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
SDK_NAME=openwrt-sdk-23.05.5-x86-64_gcc-12.3.0_musl.Linux-x86_64
|
||||||
|
SDK_URL=https://downloads.openwrt.org/releases/23.05.5/targets/x86/64/
|
||||||
|
SDK_ARCH=x86_64
|
||||||
|
SDK_EXT=tar.xz
|
Loading…
x
Reference in New Issue
Block a user