build-system: don't discard the get-or-create-build-nr script output

That was the whole point of the previous change.
Also, run the build number creation on a pull request as well (at least for a
while) so we don't need to create new releases in order to test that part of
the process).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2024-01-10 12:38:46 -08:00
parent 30efede730
commit c0c447a5b6
2 changed files with 6 additions and 1 deletions

View file

@ -3,6 +3,9 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -14,6 +17,7 @@ jobs:
- name: checkout sources
uses: actions/checkout@v4
# since we are running this step on a pull request, we will skip build numbers in releases
- name: atomically create or retrieve the build number and assemble release notes
id: version_number
run: |
@ -22,6 +26,7 @@ jobs:
# ironically, we have to upload a file, otherwise this won't create a release with just the release notes
- name: publish release
if: github.event_name == 'push'
uses: softprops/action-gh-release@v1
with:
tag_name: v$(<release-version)

View file

@ -19,7 +19,7 @@ git remote set-url origin "$url"
git push origin main
echo "build number prior to get-or-create was $(<latest-subsurface-buildnumber)"
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh "$1" &> /dev/null
bash -x subsurface/scripts/get-or-create-build-nr.sh "$1"
echo "build number after get-or-create is $(<subsurface/latest-subsurface-buildnumber)"
cp nightly-builds/latest-subsurface-buildnumber subsurface
[[ -n $3 ]] && echo "$3" > subsurface/latest-subsurface-buildnumber-extension