Skip to content

Commit 79adb83

Browse files
authored
ci: add reproduce builds workflow (#1497)
* ci: add reproduce builds workflow * ci: trigger webhook and build every day * ci: change secrets
1 parent 0c3b257 commit 79adb83

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Reproduce latest release
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 2 * * *' # every day at 02:00 night
7+
8+
jobs:
9+
reproduce:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Get latest release
16+
shell: bash
17+
run: |
18+
curl --proto '=https' \
19+
--tlsv1.2 \
20+
-sSf -L \
21+
'https://api.github.com/repos/simplex-chat/simplexmq/releases/latest' \
22+
2>/dev/null | \
23+
grep -i "tag_name" | \
24+
awk -F \" '{print "TAG="$4}' >> $GITHUB_ENV
25+
26+
- name: Execute reproduce script
27+
run: |
28+
${GITHUB_WORKSPACE}/scripts/reproduce-builds.sh "$TAG"
29+
30+
- name: Check if build has been reproduced
31+
env:
32+
url: ${{ secrets.STATUS_SIMPLEX_WEBHOOK_URL }}
33+
user: ${{ secrets.STATUS_SIMPLEX_WEBHOOK_USER }}
34+
pass: ${{ secrets.STATUS_SIMPLEX_WEBHOOK_PASS }}
35+
run: |
36+
if [ -f "${GITHUB_WORKSPACE}/$TAG/_sha256sums" ]; then
37+
exit 0
38+
else
39+
curl --proto '=https' --tlsv1.2 -sSf \
40+
-u "${user}:${pass}" \
41+
-H 'Content-Type: application/json' \
42+
-d '{"title": "👾 GitHub: Runner", "description": "⛔️ '"$TAG"' did not reproduce."}' \
43+
"$url"
44+
exit 1
45+
fi

0 commit comments

Comments
 (0)