Skip to content

Commit

Permalink
ci: update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kuoruan committed May 15, 2024
1 parent d9af06e commit a543084
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 57 deletions.
39 changes: 6 additions & 33 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand All @@ -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_
Expand All @@ -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_
Expand All @@ -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_
Expand All @@ -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 }}
Expand All @@ -120,18 +93,18 @@ 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 }}
restore-keys: |
${{ 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 }}
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ 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 }}
restore-keys: |
${{ 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 }}
Expand Down Expand Up @@ -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: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/new-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ 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 }}
restore-keys: |
${{ 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 }}
Expand Down Expand Up @@ -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: |
Expand All @@ -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 }}
Expand All @@ -84,24 +84,24 @@ 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 }}"
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"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/version-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a543084

Please sign in to comment.