Squashed commit of the following: #291
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Build Openwrt | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
get-version: | |
name: get latest version number | |
runs-on: ubuntu-latest | |
outputs: | |
CUR_VERSION: ${{steps.get-version.outputs.CUR_VERSION}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: VERSION_CONTROL | |
fetch-depth: 1 | |
path: version_control | |
- name: get version | |
id: get-version | |
run: | | |
#获取当前版本号 | |
pre_version=$(cat version_control/VERSION | grep "PREFEX" | sed 's/PREFEX=\(.*\)/\1/') | |
cur_version=$(cat version_control/VERSION | grep "CUR_VERS" | sed 's/CUR_VERS=\(.*\)/\1/') | |
echo "CUR_VERSION=$pre_version$cur_version" >> $GITHUB_OUTPUT | |
release: | |
name: Build for ${{ matrix.arch }} | |
needs: get-version | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: aarch64_cortex-a53 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/bcm27xx/bcm2710 | |
sdk_name: -sdk-23.05.2-bcm27xx-bcm2710_ | |
- arch: aarch64_cortex-a72 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/mvebu/cortexa72 | |
sdk_name: -sdk-23.05.2-mvebu-cortexa72_ | |
- arch: aarch64_generic | |
sdk_url_path: http://downloads.openwrt.org/releases/23.05.2/targets/layerscape/armv8_64b | |
sdk_name: -sdk-23.05.2-layerscape-armv8_64b_ | |
- arch: arm_arm1176jzf-s_vfp | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/bcm27xx/bcm2708 | |
sdk_name: -sdk-23.05.2-bcm27xx-bcm2708_ | |
#- arch: arm_arm926ej-s #build openssl failed | |
# sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/at91/legacy | |
# sdk_name: -sdk-23.05.2-at91-legacy_ | |
- arch: arm_cortex-a15_neon-vfpv4 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/ipq806x/generic | |
sdk_name: -sdk-23.05.2-ipq806x-generic_ | |
- arch: arm_cortex-a5-vfpv4 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/at91/sama5 | |
sdk_name: -sdk-23.05.2-at91-sama5_ | |
- arch: arm_cortex-a7_neon-vfpv4 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/bcm27xx/bcm2709 | |
sdk_name: -sdk-23.05.2-bcm27xx-bcm2709_ | |
- arch: arm_cortex-a8_vfpv3 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/sunxi/cortexa8 | |
sdk_name: -sdk-23.05.2-sunxi-cortexa8_ | |
- arch: arm_cortex-a9 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/bcm53xx/generic | |
sdk_name: -sdk-23.05.2-bcm53xx-generic_ | |
#- arch: arm_cortex-a9_neon | |
# sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/imx6/generic | |
# sdk_name: -sdk-23.05.2-imx6_ | |
#- arch: arm_cortex-a9_vfpv3 | |
# sdk_url_path: https://downloads.openwrt.org/releases/19.07.2/targets/mvebu/cortexa9 | |
# sdk_name: -sdk-23.05.2-19.07.2-mvebu-cortexa9_ | |
- arch: arm_cortex-a9_vfpv3-d16 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/mvebu/cortexa9 | |
sdk_name: -sdk-23.05.2-mvebu-cortexa9_ | |
- arch: arm_fa526 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/gemini/generic | |
sdk_name: -sdk-23.05.2-gemini-generic_ | |
- arch: arm_mpcore | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/oxnas/ox820 | |
sdk_name: -sdk-23.05.2-oxnas-ox820_ | |
#- arch: arm_mpcore_vfp | |
# sdk_url_path: https://downloads.openwrt.org/releases/19.07.7/targets/cns3xxx/generic | |
# sdk_name: -sdk-23.05.2-19.07.7-cns3xxx_ | |
- arch: arm_xscale | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/kirkwood/generic | |
sdk_name: -sdk-23.05.2-kirkwood-generic_ | |
- arch: i386_pentium | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/x86/legacy | |
sdk_name: -sdk-23.05.2-x86-legacy_ | |
- arch: i386_pentium4 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/x86/generic | |
sdk_name: -sdk-23.05.2-x86-generic_ | |
- arch: mips64_octeon | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/octeon/generic | |
sdk_name: -sdk-23.05.2-octeon-generic_ | |
- arch: mipsel_24kc | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/ramips/mt7620 | |
sdk_name: -sdk-23.05.2-ramips-mt7620_ | |
- arch: mipsel_24kc_24kf | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/pistachio/generic | |
sdk_name: -sdk-23.05.2-pistachio-generic_ | |
- arch: mipsel_74kc | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/bcm47xx/mips74k | |
sdk_name: -sdk-23.05.2-bcm47xx-mips74k_ | |
- arch: mipsel_mips32 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/bcm47xx/generic | |
sdk_name: -sdk-23.05.2-bcm47xx-generic_ | |
- arch: mips_24kc | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/ath79/generic | |
sdk_name: -sdk-23.05.2-ath79-generic_ | |
- arch: mips_mips32 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/bcm63xx/generic | |
sdk_name: -sdk-23.05.2-bcm63xx-generic_ | |
- arch: x86_64 | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/x86/64 | |
sdk_name: -sdk-23.05.2-x86-64_ | |
- arch: powerpc_464fp | |
sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/apm821xx/nand | |
sdk_name: -sdk-23.05.2-apm821xx-nand_ | |
#- arch: powerpc_8540 | |
# sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/mpc85xx/generic | |
# sdk_name: -sdk-23.05.2-mpc85xx-generic_ | |
# - arch: arc_arc700 | |
# sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/arc770/generic | |
# sdk_name: -sdk-23.05.2-arc770-generic_ | |
# - arch: arc_archs | |
# sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/archs38/generic | |
# sdk_name: -sdk-23.05.2-archs38-generic_ | |
# - arch: armeb_xscale | |
# sdk_url_path: https://downloads.openwrt.org/releases/23.05.2/targets/ixp4xx/generic | |
# sdk_name: -sdk-23.05.2-ixp4xx-generic_ | |
env: | |
SDK_URL_PATH: ${{ matrix.sdk_url_path }} | |
SDK_NAME: ${{ matrix.sdk_name }} | |
ARCH: ${{ matrix.arch }} | |
CACHE_DIR: ~/cache | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CACHE_DIR }} | |
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:release:cache:${{ github.run_number }} | |
restore-keys: | | |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache: | |
- name: Setup CCache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:release:ccache:${{ github.run_number }} | |
restore-keys: | | |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache: | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -yq gettext libncurses5-dev rsync xsltproc | |
- name: Prepare For Build | |
run: | | |
sdk_home="$(mktemp -d)" | |
test -d ~/.ccache || mkdir -p ~/.ccache | |
ln -sf ~/.ccache "$sdk_home/.ccache" | |
echo "SDK_HOME=$sdk_home" >> $GITHUB_ENV | |
echo "CONFIG_CCACHE=y" >> $GITHUB_ENV | |
#修改版本号 | |
sed -i "s/VER=.*/VER=${{needs.get-version.outputs.CUR_VERSION}}/" ${{ github.workspace }}/package/openwrt/make_openwrt.sh | |
- name: Build package | |
env: | |
OPENWRT_GOLANG_COMMIT: ${{ secrets.OPENWRT_GOLANG_COMMIT }} | |
run: sh ${{ github.workspace }}/package/openwrt/make_openwrt.sh | |
- name: Show CCache Status | |
run: | | |
eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s" | |
# - name: Upload To Artifact | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: smartdns-${{ matrix.arch }}-static | |
# path: "package/openwrt/smartdns*.ipk" | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "release_tag=${{needs.get-version.outputs.CUR_VERSION}}-OpenWrt-openssl3" >> $GITHUB_OUTPUT | |
touch release.txt | |
echo "同步更新上游代码" >> release.txt | |
echo ${{ github.sha }} >> Release.txt | |
echo "status=success" >> $GITHUB_OUTPUT | |
- name: Upload firmware to release | |
uses: softprops/[email protected] | |
if: steps.tag.outputs.status == 'success' | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
# do not use GITHUB_TOKEN | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
body_path: release.txt | |
files: ${{ github.workspace }}/package/openwrt/smartdns*.ipk |