From a5430849c2c243b1fd01604b50cd7f7e353b0e5a Mon Sep 17 00:00:00 2001 From: Xingwang Liao Date: Wed, 15 May 2024 15:15:49 +0800 Subject: [PATCH] ci: update github actions --- .github/workflows/build-release.yml | 39 +++++------------------------ .github/workflows/build-test.yml | 8 +++--- .github/workflows/new-tag.yml | 24 +++++++++--------- .github/workflows/version-scan.yml | 16 ++++++------ 4 files changed, 30 insertions(+), 57 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index ea09abd..4371412 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -25,9 +25,6 @@ jobs: - arch: arm_arm1176jzf-s_vfp sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2708 sdk_name: -sdk-bcm27xx-bcm2708_ - - arch: arm_arm926ej-s - sdk_url_path: https://downloads.openwrt.org/snapshots/targets/at91/legacy - sdk_name: -sdk-at91-legacy_ - arch: arm_cortex-a15_neon-vfpv4 sdk_url_path: https://downloads.openwrt.org/snapshots/targets/ipq806x/generic sdk_name: -sdk-ipq806x-generic_ @@ -44,11 +41,8 @@ jobs: sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm53xx/generic sdk_name: -sdk-bcm53xx-generic_ - arch: arm_cortex-a9_neon - sdk_url_path: https://downloads.openwrt.org/snapshots/targets/imx6/generic - sdk_name: -sdk-imx6_ - - arch: arm_cortex-a9_vfpv3 - sdk_url_path: https://downloads.openwrt.org/releases/19.07.2/targets/mvebu/cortexa9 - sdk_name: -sdk-19.07.2-mvebu-cortexa9_ + sdk_url_path: https://downloads.openwrt.org/snapshots/targets/imx/cortexa9 + sdk_name: -sdk-imx-cortexa9_ - arch: arm_cortex-a9_vfpv3-d16 sdk_url_path: https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa9 sdk_name: -sdk-mvebu-cortexa9_ @@ -58,9 +52,6 @@ jobs: - arch: arm_mpcore sdk_url_path: https://downloads.openwrt.org/snapshots/targets/oxnas/ox820 sdk_name: -sdk-oxnas-ox820_ - - arch: arm_mpcore_vfp - sdk_url_path: https://downloads.openwrt.org/releases/19.07.7/targets/cns3xxx/generic - sdk_name: -sdk-19.07.7-cns3xxx_ - arch: arm_xscale sdk_url_path: https://downloads.openwrt.org/snapshots/targets/kirkwood/generic sdk_name: -sdk-kirkwood_ @@ -70,9 +61,6 @@ jobs: - arch: i386_pentium4 sdk_url_path: https://downloads.openwrt.org/snapshots/targets/x86/generic sdk_name: -sdk-x86-generic_ - - arch: mips64_octeon - sdk_url_path: http://downloads.openwrt.org/releases/18.06.5/targets/octeon/generic - sdk_name: -sdk-18.06.5-octeon_ - arch: mips64_octeonplus sdk_url_path: https://downloads.openwrt.org/snapshots/targets/octeon/generic sdk_name: -sdk-octeon_ @@ -97,21 +85,6 @@ jobs: - arch: x86_64 sdk_url_path: https://downloads.openwrt.org/snapshots/targets/x86/64 sdk_name: -sdk-x86-64_ - # - arch: arc_arc700 - # sdk_url_path: https://downloads.openwrt.org/snapshots/targets/arc770/generic - # sdk_name: -sdk-arc770-generic_ - # - arch: arc_archs - # sdk_url_path: https://downloads.openwrt.org/snapshots/targets/archs38/generic - # sdk_name: -sdk-archs38-generic_ - # - arch: armeb_xscale - # sdk_url_path: https://downloads.openwrt.org/snapshots/targets/ixp4xx/generic - # sdk_name: -sdk-ixp4xx-generic_ - # - arch: powerpc_464fp - # sdk_url_path: https://downloads.openwrt.org/snapshots/targets/apm821xx/nand - # sdk_name: -sdk-apm821xx-nand_ - # - arch: powerpc_8540 - # sdk_url_path: https://downloads.openwrt.org/snapshots/targets/mpc85xx/generic - # sdk_name: -sdk-mpc85xx-generic_ env: SDK_URL_PATH: ${{ matrix.sdk_url_path }} @@ -120,10 +93,10 @@ jobs: CACHE_DIR: ~/cache steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_DIR }} key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:release:cache:${{ github.run_number }} @@ -131,7 +104,7 @@ jobs: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache: - name: Setup CCache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.ccache key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:release:ccache:${{ github.run_number }} @@ -163,7 +136,7 @@ jobs: eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s" - name: Release and Upload Assets - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: "*.ipk" env: diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 640a701..4b3df6d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -18,10 +18,10 @@ jobs: CACHE_DIR: ~/cache steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_DIR }} key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache:${{ github.run_number }} @@ -29,7 +29,7 @@ jobs: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache: - name: Setup CCache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.ccache key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache:${{ github.run_number }} @@ -61,7 +61,7 @@ jobs: eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s" - name: Save Build Result - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: v2ray-core path: | diff --git a/.github/workflows/new-tag.yml b/.github/workflows/new-tag.yml index d3afcf0..cce8fee 100644 --- a/.github/workflows/new-tag.yml +++ b/.github/workflows/new-tag.yml @@ -17,10 +17,10 @@ jobs: CACHE_DIR: ~/cache steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_DIR }} key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache:${{ github.run_number }} @@ -28,7 +28,7 @@ jobs: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache: - name: Setup CCache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.ccache key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache:${{ github.run_number }} @@ -60,7 +60,7 @@ jobs: eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s" - name: Save Build Result - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: v2ray-core path: | @@ -72,7 +72,7 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 10 token: ${{ secrets.PAT }} @@ -84,15 +84,15 @@ jobs: pkg_release="$(grep '^PKG_RELEASE:' Makefile 2>/dev/null | cut -d'=' -f2)" if [ "${GITHUB_REF#refs/heads/}" = "releases/v${pkg_version}-${pkg_release}" ] ; then - echo "::set-output name=version::$pkg_version" - echo "::set-output name=release::$pkg_release" + echo "version=$pkg_version" >> $GITHUB_OUTPUT + echo "release=$pkg_release" >> $GITHUB_OUTPUT else - echo "::set-output name=version::0" - echo "::set-output name=release::0" + echo "version=" >> $GITHUB_OUTPUT + echo "release=" >> $GITHUB_OUTPUT fi - name: Commit New Tag - if: steps.get_version.outputs.version != '0' && steps.get_version.outputs.release != '0' + if: steps.get_version.outputs.version != '' && steps.get_version.outputs.release != '' run: | version="${{ steps.get_version.outputs.version }}" release="${{ steps.get_version.outputs.release }}" @@ -100,8 +100,8 @@ jobs: tag_name="v${version}-${release}" release_branch="releases/$tag_name" - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" git checkout "$release_branch" diff --git a/.github/workflows/version-scan.yml b/.github/workflows/version-scan.yml index 93c24a4..22b228e 100644 --- a/.github/workflows/version-scan.yml +++ b/.github/workflows/version-scan.yml @@ -12,13 +12,13 @@ jobs: if: ${{ github.repository_owner }} == "kuoruan" steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} - name: Get Latest Version id: get_version - uses: actions/github-script@v3 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} result-encoding: string @@ -47,11 +47,11 @@ jobs: "https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$latest_version" | \ sha256sum | cut -d' ' -f1)" - echo "::set-output name=version::$latest_version" - echo "::set-output name=source_hash::$source_hash" + echo "version=$latest_version" >> $GITHUB_OUTPUT + echo "source_hash=$source_hash" >> $GITHUB_OUTPUT else - echo "::set-output name=version::" - echo "::set-output name=source_hash::" + echo "version=" >> $GITHUB_OUTPUT + echo "source_hash=" >> $GITHUB_OUTPUT fi - name: Commit New Version @@ -62,8 +62,8 @@ jobs: release_branch="releases/v${version}-1" - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" if [ "$(git ls-remote origin "$release_branch" | wc -l)" -gt "0" ] ; then # delete existing release branch