release #246
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: release | |
on: | |
schedule: | |
- cron: "0 0 * * 4" | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "*.zip" | |
- "*.dgst" | |
- "README.md" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout out project files | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Check and release | |
run: | | |
CORE_TAG_URL="https://api.github.com/repos/v2fly/v2ray-core/releases/latest" | |
CORE_LATEST_VER=`curl -s ${CORE_TAG_URL} --connect-timeout 5 | grep 'tag_name' | cut -d\" -f4` | |
if [[ ${CORE_LATEST_VER} != v* ]]; then | |
CORE_LATEST_VER=v${CORE_LATEST_VER} | |
fi | |
DIST_TAGS_URL="https://api.github.com/repos/${{ github.repository }}/tags" | |
DIST_TAG_FOUND=`curl -s ${DIST_TAGS_URL} --connect-timeout 5 | grep "\"name\"\: \"${CORE_LATEST_VER}\""` || true | |
if [ -z ${DIST_TAG_FOUND} ]; then | |
find . -type 'f' ! -name 'README.md' ! -path './.git**' -exec rm -rf {} \; | |
for file in $(curl -sSL $CORE_TAG_URL | grep 'browser_download_url' | cut -d\" -f4); do | |
wget $file | |
done | |
git add . | |
git config user.name "Darien Raymond" | |
git config user.email "admin@v2ray.com" | |
git commit -m "Version ${CORE_LATEST_VER}" | |
git tag -a "${CORE_LATEST_VER}" -m "Version ${CORE_LATEST_VER}" | |
git remote add release "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -u --follow-tags release master | |
fi |