build-system: use GitHub Actions outputs

Tempting as it is to think this is just like bash - yaml isn't bash at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2024-01-10 13:02:48 -08:00
parent c0c447a5b6
commit 9aa9bec914
5 changed files with 17 additions and 6 deletions

View file

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

View file

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

View file

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

View file

@ -23,13 +23,15 @@ jobs:
run: |
bash -x ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
bash scripts/create-releasenotes.sh ${{ github.event.head_commit.id }}
version=$(<release-version)
echo "version=$version" >> $GITHUB_OUTPUT
# 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)
tag_name: v${{ steps.version_number.outputs.version }}
repository: subsurface/nightly-builds
token: ${{ secrets.NIGHTLY_BUILDS }}
prerelease: false

View file

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