-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (68 loc) · 2.55 KB
/
schedule.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
name: Daily schedule
on:
schedule:
- cron: "* */6 * * *"
jobs:
fetch-versions:
name: "Fetch Beta and Stable releases"
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- master
- beta
steps:
- name: Checkout code
uses: actions/checkout@master
with:
ref: "${{ matrix.branch }}"
token: "${{ secrets.PAT }}"
- run: |
echo "I've checked out the ${{ matrix.branch }} branch"
git status
- name: Fetch stable release version
if: matrix.branch == 'master'
run: |
curl -sL https://formulae.brew.sh/api/cask/folding-at-home.json | \
jq -r ".version" > build/.version
cat build/.version
- name: Fetch beta release version
if: matrix.branch == 'beta'
run: |
MAJOR_VER=$( \
curl https://download.foldingathome.org/releases/beta/release/fahclient/debian-stable-64bit/ | \
grep "href" | \
sed -e "s#/<.*##g" -e "s#.*/\">##g" | \
grep -o "^v.*" | \
sort --version-sort | \
tail -n1 \
)
curl https://download.foldingathome.org/releases/beta/release/fahclient/debian-stable-64bit/${MAJOR_VER}/ | \
grep deb | \
sed -e "s#deb.*#deb#g" -e "s#.*fah#fah#g" -e "s#.*latest.*##g" | \
grep -o "^fah.*\.deb$" | \
sort --version-sort | \
tail -n1 | \
sed -e "s#fahclient_##g" -e "s#_amd64.deb##g" > build/.version
cat build/.version
# - name: Update Dockerfile version
# run: |
# VERSION=$(cat build/.version)
# sed -i '' "s/ VERSION=.*/ VERSION=${VERSION}/g" build/Dockerfile
- name: Check for modified files
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
- name: Commit release version update
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Stefan Crain'
git config --global user.email '[email protected]'
git commit --all --signoff --message="Adding new release version $(cat build/.version)" || exit 0
git tag --annotate $(cat build/.version) --message="Automatic bump to $(cat build/.version)"
- name: Push changes + tags
uses: ad-m/github-push-action@master
with:
tags: true
branch: "${{ matrix.branch }}"
github_token: "${{ secrets.PAT }}"