File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 with :
3838 key : ${{ matrix.cfg.target }}
3939
40+ - name : Recreate the latest release for this commit
41+ if : github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && github.ref == 'refs/heads/master'
42+ shell : bash
43+ env :
44+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+ run : ./scripts/ci_latest_release.sh
4046 - name : Determine Release
4147 id : vars
4248 shell : bash
@@ -141,6 +147,12 @@ jobs:
141147 with :
142148 key : ubuntu22-linux
143149
150+ - name : Recreate the latest release for this commit
151+ if : github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && github.ref == 'refs/heads/master'
152+ shell : bash
153+ env :
154+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
155+ run : ./scripts/ci_latest_release.sh
144156 - name : Determine Release
145157 shell : bash
146158 run : |
@@ -219,6 +231,12 @@ jobs:
219231 with :
220232 key : arm64-linux
221233
234+ - name : Recreate the latest release for this commit
235+ if : github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && github.ref == 'refs/heads/master'
236+ shell : bash
237+ env :
238+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
239+ run : ./scripts/ci_latest_release.sh
222240 - name : Determine Release
223241 shell : bash
224242 run : |
Original file line number Diff line number Diff line change 3737 node-version : 26
3838 - name : Setup
3939 run : ./scripts/osx/setup_environment.sh
40+ - name : Recreate the latest release for this commit
41+ if : github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && github.ref == 'refs/heads/master'
42+ shell : bash
43+ env :
44+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+ run : ./scripts/ci_latest_release.sh
4046 - name : Determine Release
4147 id : vars
4248 shell : bash
Original file line number Diff line number Diff line change 4242 zip
4343 rsync
4444 wget
45+ - name : Recreate the latest release for this commit
46+ if : github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && github.ref == 'refs/heads/master'
47+ shell : bash
48+ env :
49+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+ run : ./scripts/ci_latest_release.sh
4551 - name : Determine Release
4652 id : vars
4753 shell : bash
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # master builds upload to the "latest" release. The first build job of a push recreates it at that
4+ # commit, so its date and tag are this build's; jobs that start later (a runner can queue for half
5+ # an hour) see the tag already there and leave it, so nothing already uploaded is deleted.
6+ # Re-running an older master build doesn't touch a newer latest.
7+
8+ REPO=" ${GITHUB_REPOSITORY:? } "
9+ SHA=" ${GITHUB_SHA:? } "
10+
11+ head=$( gh api " repos/$REPO /commits/master" --jq ' .sha' 2> /dev/null || true)
12+ if [ " $head " != " $SHA " ]; then
13+ echo " ${SHA: 0: 7} isn't the master head (${head: 0: 7} ) - leaving latest"
14+ exit 0
15+ fi
16+
17+ current=$( gh api " repos/$REPO /git/ref/tags/latest" --jq ' .object.sha' 2> /dev/null || true)
18+ if [ " $current " = " $SHA " ]; then
19+ echo " latest is already at ${SHA: 0: 7} "
20+ exit 0
21+ fi
22+
23+ echo " recreating latest at ${SHA: 0: 7} (was ${current: 0: 7} )"
24+ gh release delete latest --repo " $REPO " --cleanup-tag --yes || echo " no latest release yet"
25+ # another build job may create it at the same moment
26+ gh release create latest --repo " $REPO " --target " $SHA " --title latest --latest=false \
27+ --notes " Latest master build from ${SHA: 0: 7} (copied to nightly every night). Files are added as each platform finishes building." \
28+ || gh release view latest --repo " $REPO " > /dev/null
You can’t perform that action at this time.
0 commit comments