-
Notifications
You must be signed in to change notification settings - Fork 224
43 lines (42 loc) · 1.59 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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