From c33e05c1d4de7c5375dcebced4a9d148a54b8fe8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 10 Jan 2024 06:48:23 -0800 Subject: [PATCH] build-system: create release notes only once Some experimentation showed what should have been obvious. The release information is additive. So it's enough if ONE of the actions creates release notes, all the others can simply add additional release artifacts. To make this more obvious, this commit creates a new action that does nothing but create the release notes and publish the release. Since it really doesn't do anything else, it's likely to be the quickest to complete, but that doesn't matter - the last action that has a body or body_path in the gh-release action determines the release notes. And we now have exactly one action that does so. Signed-off-by: Dirk Hohndel --- .github/workflows/android.yml | 3 --- .github/workflows/linux-trusty-5.12.yml | 5 ---- .github/workflows/mac.yml | 5 ---- .github/workflows/post-releasenotes.yml | 31 +++++++++++++++++++++++++ .github/workflows/windows.yml | 5 ---- 5 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/post-releasenotes.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index d20a55031..a42af2f18 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -10,7 +10,6 @@ on: env: BUILD_ROOT: ${{ github.workspace }}/.. KEYSTORE_FILE: ${{ github.workspace }}/../subsurface.keystore - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: buildAndroid: @@ -28,7 +27,6 @@ jobs: run: | version="$(bash 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 }} - name: store dummy version and build number for non-push build runs if: github.event_name != 'push' @@ -79,7 +77,6 @@ jobs: fail_on_unmatched_files: true files: | Subsurface-mobile*.apk - body_path: gh_release_notes - name: delete the keystore if: github.event_name == 'push' diff --git a/.github/workflows/linux-trusty-5.12.yml b/.github/workflows/linux-trusty-5.12.yml index 2aada0ff6..1ed7658f5 100644 --- a/.github/workflows/linux-trusty-5.12.yml +++ b/.github/workflows/linux-trusty-5.12.yml @@ -7,9 +7,6 @@ on: branches: - master -env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - jobs: buildAppImage: runs-on: ubuntu-latest @@ -26,7 +23,6 @@ jobs: run: | version=$(bash ./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 }} - name: store dummy version and build number for pull request if: github.event_name == 'pull_request' @@ -74,4 +70,3 @@ jobs: fail_on_unmatched_files: true files: | ./Subsurface*.AppImage - body_path: gh_release_notes \ No newline at end of file diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index a59742b62..030af38b4 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -7,9 +7,6 @@ on: branches: - master -env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - jobs: buildMac: runs-on: macOS-11 @@ -23,7 +20,6 @@ jobs: run: | version=$(bash ./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 }} - name: store dummy version and build number for pull request if: github.event_name == 'pull_request' @@ -69,4 +65,3 @@ jobs: prerelease: false fail_on_unmatched_files: true files: ${{ steps.build.outputs.dmg }} - body_path: gh_release_notes diff --git a/.github/workflows/post-releasenotes.yml b/.github/workflows/post-releasenotes.yml new file mode 100644 index 000000000..e1636ec30 --- /dev/null +++ b/.github/workflows/post-releasenotes.yml @@ -0,0 +1,31 @@ +name: Post Release +on: + push: + branches: + - master + +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + postRelease: + runs-on: ubuntu-latest + steps: + - name: checkout sources + uses: actions/checkout@v1 + + - name: atomically create or retrieve the build number and assemble release notes + id: version_number + run: | + version=$(bash ./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 }} + + - name: publish release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.version_number.outputs.version }} + repository: subsurface/nightly-builds + token: ${{ secrets.NIGHTLY_BUILDS }} + prerelease: false + body_path: gh_release_notes diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7d4ea9dc2..aee406884 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -7,9 +7,6 @@ on: branches: - master -env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - jobs: buildWindows: runs-on: ubuntu-latest @@ -26,7 +23,6 @@ jobs: run: | version=$(bash ./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 }} - name: store dummy version and build number for pull request if: github.event_name == 'pull_request' @@ -64,4 +60,3 @@ jobs: files: | ./subsurface*.exe* ./smtk2ssrf*.exe - body_path: gh_release_notes