chore: bump to v5.18.0-1 #53
Workflow file for this run
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: New Tag | |
on: | |
push: | |
branches: | |
- "releases/v*" | |
tags-ignore: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
SDK_URL_PATH: https://downloads.openwrt.org/snapshots/targets/x86/64 | |
SDK_NAME: -sdk-x86-64_ | |
ARCH: x86_64 | |
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 }}:cache:${{ github.run_number }} | |
restore-keys: | | |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache: | |
- name: Setup CCache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}: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 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 | |
- name: Build package | |
env: | |
OPENWRT_GOLANG_COMMIT: ${{ secrets.OPENWRT_GOLANG_COMMIT }} | |
run: sh compile.sh | |
- name: Show CCache Status | |
run: | | |
eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s" | |
- name: Save Build Result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: v2ray-core | |
path: | | |
*.ipk | |
retention-days: 7 | |
tag: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
token: ${{ secrets.PAT }} | |
- name: Get Version | |
id: get_version | |
run: | | |
pkg_version="$(grep '^PKG_VERSION:' Makefile 2>/dev/null | cut -d'=' -f2)" | |
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 "version=$pkg_version" >> $GITHUB_OUTPUT | |
echo "release=$pkg_release" >> $GITHUB_OUTPUT | |
else | |
echo "version=" >> $GITHUB_OUTPUT | |
echo "release=" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit New Tag | |
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.actor }}" | |
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | |
git checkout "$release_branch" | |
git fetch origin master:master | |
git rebase master | |
git checkout master | |
git rebase "$release_branch" | |
git push origin HEAD:master | |
git tag -a "$tag_name" -m "$tag_name" | |
git push origin "$tag_name" | |
git push origin --delete "$release_branch" |