build-system: small changes for better debugging

In order to make it easier to see what's happening inside get-atomic-buildnr.sh
write the result to a file that can be read by the caller. Not quite as
elegant, but hopefully more practical to see what's going wrong when no new
build number is created.

Make sure that post-releasenotes is successfull by actually posting a release
artifact (apparently the gh release action otherwise quietly fails).

Try to ensure we find the Android APK when uploading to the release.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2024-01-10 07:11:27 -08:00
parent c33e05c1d4
commit 30efede730
9 changed files with 26 additions and 25 deletions

View file

@ -25,8 +25,7 @@ jobs:
id: version_number id: version_number
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
version="$(bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")" bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for non-push build runs - name: store dummy version and build number for non-push build runs
if: github.event_name != 'push' if: github.event_name != 'push'
@ -70,13 +69,13 @@ jobs:
if: github.event_name == 'push' if: github.event_name == 'push'
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
tag_name: v${{ steps.version_number.outputs.version }} tag_name: v$(<release-version)
repository: subsurface/nightly-builds repository: subsurface/nightly-builds
token: ${{ secrets.NIGHTLY_BUILDS }} token: ${{ secrets.NIGHTLY_BUILDS }}
prerelease: false prerelease: false
fail_on_unmatched_files: true fail_on_unmatched_files: true
files: | files: |
Subsurface-mobile*.apk "$GITHUB_WORKSPACE"/Subsurface-mobile*.apk
- name: delete the keystore - name: delete the keystore
if: github.event_name == 'push' if: github.event_name == 'push'

View file

@ -29,7 +29,8 @@ jobs:
id: version_number id: version_number
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
version=$(bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
version=$(<release-version)
echo "version=$version" >> $GITHUB_OUTPUT echo "version=$version" >> $GITHUB_OUTPUT
- name: Setup API token for copr-cli - name: Setup API token for copr-cli

View file

@ -24,8 +24,7 @@ jobs:
id: version_number id: version_number
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
version=$(bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request - name: store dummy version and build number for pull request
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'

View file

@ -21,8 +21,7 @@ jobs:
id: version_number id: version_number
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
version=$(bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request - name: store dummy version and build number for pull request
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
@ -56,14 +55,14 @@ jobs:
- name: prepare release artifacts - name: prepare release artifacts
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
mv Subsurface.AppImage Subsurface-v${{ steps.version_number.outputs.version }}.AppImage mv Subsurface.AppImage Subsurface-v(<release-version).AppImage
# only publish a 'release' on push events (those include merging a PR) # only publish a 'release' on push events (those include merging a PR)
- name: upload binaries - name: upload binaries
if: github.event_name == 'push' if: github.event_name == 'push'
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
tag_name: v${{ steps.version_number.outputs.version }} tag_name: v$(<release-version)
repository: subsurface/nightly-builds repository: subsurface/nightly-builds
token: ${{ secrets.NIGHTLY_BUILDS }} token: ${{ secrets.NIGHTLY_BUILDS }}
prerelease: false prerelease: false

View file

@ -18,8 +18,7 @@ jobs:
id: version_number id: version_number
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
version=$(bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request - name: store dummy version and build number for pull request
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
@ -59,7 +58,7 @@ jobs:
if: github.event_name == 'push' if: github.event_name == 'push'
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
tag_name: v${{ steps.version_number.outputs.version }} tag_name: v$(<release-version)
repository: subsurface/nightly-builds repository: subsurface/nightly-builds
token: ${{ secrets.NIGHTLY_BUILDS }} token: ${{ secrets.NIGHTLY_BUILDS }}
prerelease: false prerelease: false

View file

@ -12,20 +12,21 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout sources - name: checkout sources
uses: actions/checkout@v1 uses: actions/checkout@v4
- name: atomically create or retrieve the build number and assemble release notes - name: atomically create or retrieve the build number and assemble release notes
id: version_number id: version_number
run: | run: |
version=$(bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") bash -x ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
echo "version=$version" >> $GITHUB_OUTPUT
bash scripts/create-releasenotes.sh ${{ github.event.head_commit.id }} bash scripts/create-releasenotes.sh ${{ github.event.head_commit.id }}
# ironically, we have to upload a file, otherwise this won't create a release with just the release notes
- name: publish release - name: publish release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
tag_name: v${{ steps.version_number.outputs.version }} tag_name: v$(<release-version)
repository: subsurface/nightly-builds repository: subsurface/nightly-builds
token: ${{ secrets.NIGHTLY_BUILDS }} token: ${{ secrets.NIGHTLY_BUILDS }}
prerelease: false prerelease: false
files: gh_release_notes
body_path: gh_release_notes body_path: gh_release_notes

View file

@ -18,8 +18,7 @@ jobs:
id: version_number id: version_number
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
version=$(bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Setup build dependencies - name: Setup build dependencies
run: | run: |

View file

@ -21,8 +21,7 @@ jobs:
id: version_number id: version_number
if: github.event_name == 'push' if: github.event_name == 'push'
run: | run: |
version=$(bash ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request - name: store dummy version and build number for pull request
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
@ -52,7 +51,7 @@ jobs:
if: github.event_name == 'push' if: github.event_name == 'push'
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
tag_name: v${{ steps.version_number.outputs.version }} tag_name: v$(<release-version)
repository: subsurface/nightly-builds repository: subsurface/nightly-builds
token: ${{ secrets.NIGHTLY_BUILDS }} token: ${{ secrets.NIGHTLY_BUILDS }}
prerelease: false prerelease: false

View file

@ -4,7 +4,10 @@
# token this will not work when run from the command line # token this will not work when run from the command line
# call it from the default position in the filesystem (which is inside the subsurface git tree) # call it from the default position in the filesystem (which is inside the subsurface git tree)
# #
# Usage: get-atimic-buildnr.sh SHA secrets.NIGHTLY_BUILDS [extra-name-component] # Usage: get-atomic-buildnr.sh SHA secrets.NIGHTLY_BUILDS [extra-name-component]
#
# the resulting release version is stored in the file ./release-version
# checkout the nightly-builds repo in parallel to the main repo # checkout the nightly-builds repo in parallel to the main repo
# the clone followed by the pointless push should verify that the password is stored in the config # the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password # that way the script doesn't need the password
@ -14,8 +17,10 @@ git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds cd nightly-builds
git remote set-url origin "$url" git remote set-url origin "$url"
git push origin main git push origin main
echo "build number prior to get-or-create was $(<latest-subsurface-buildnumber)"
cd .. 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" &> /dev/null
echo "build number after get-or-create is $(<subsurface/latest-subsurface-buildnumber)"
cp nightly-builds/latest-subsurface-buildnumber subsurface cp nightly-builds/latest-subsurface-buildnumber subsurface
[[ -n $3 ]] && echo "$3" > subsurface/latest-subsurface-buildnumber-extension [[ -n $3 ]] && echo "$3" > subsurface/latest-subsurface-buildnumber-extension
bash subsurface/scripts/get-version bash subsurface/scripts/get-version > subsurface/release-version