Skip to content

chore: bump to v5.9.0-1 #23

chore: bump to v5.9.0-1

chore: bump to v5.9.0-1 #23

Workflow file for this run

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@v2
- name: Setup Cache
uses: actions/cache@v2
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
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@v2
with:
name: v2ray-core
path: |
*.ipk
retention-days: 7
tag:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
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 "::set-output name=version::$pkg_version"
echo "::set-output name=release::$pkg_release"
else
echo "::set-output name=version::0"
echo "::set-output name=release::0"
fi
- name: Commit New Tag
if: steps.get_version.outputs.version != '0' && steps.get_version.outputs.release != '0'
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 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"