diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index deb290761..a9bd020ca 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -7,6 +7,7 @@ on: branches: - master + env: BUILD_ROOT: ${{ github.workspace }}/.. KEYSTORE_FILE: ${{ github.workspace }}/../subsurface.keystore @@ -21,12 +22,25 @@ jobs: - name: checkout sources uses: actions/checkout@v4 + - name: get pull request information from corresponding merge + if: github.event_name == 'push' + id: get_pr + uses: pablogamboa/action-get-merged-pull-request@v1.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: atomically create or retrieve the build number id: version_number if: github.event_name == 'push' run: | - version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") + version=$(bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release") echo "version=$version" >> $GITHUB_OUTPUT + pr_num = ${{ steps.get_pr.outputs.number }} + pr_url = ${{ steps.get_pr.outputs.html_url }} + pr_title = ${{ steps.get_pr.outputs.title }} + commit_id = ${{ github.event.head_commit.id }} + commit_url = ${{ github.event.head_commit.url }} + bash scripts/create-releasenotes.sh "$pr_num" "$pr_url" "$pr_title" "$commit_id" "$commit_url" - name: store dummy version and build number for non-push build runs if: github.event_name != 'push' @@ -73,24 +87,7 @@ jobs: fail_on_unmatched_files: true files: | Subsurface-mobile*.apk - body: | - CICD release artifact - - These builds are created on every merge or push into the [Subsurface repo](http://github.com/subsurface/subsurface). - - This build is based on changeset ${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }})): - ${{ github.event.head_commit.message }} - - None of these artifacts are signed with an official key. - The Android APK can be side-loaded on most Android devices. If you had a previous Subsurface-mobile version installed from the Google Play store, you'll have to uninstall that first. - The Windows installer will ask you to confirm installation of an app from an unknown developer. - The macOS DMG makes it even harder with a multi-step dance that requires opening the Privacy & Security settings in the System Preferences and explicitly confirming that you are willing to install this app. - - You can find similar Subsurface-Daily builds for [Ubuntu](https://ppa.launchpadcontent.net/subsurface) and Subsurface-test for [Fedora](https://copr.fedorainfracloud.org/coprs/dirkhh/Subsurface-test). - - **Note:** Due to the asynchronous nature of our build process the artifacts for the individual platforms are added to the release one by one, whenever their build is finished. So if you can not find a particular artifact on a recent (less than 2 hours old) build, please come back later and check again. - - Please report any issues with these builds in the [Subsurface user forum](https://groups.google.com/g/subsurface-divelog). + body_path: gh_release_notes - name: delete the keystore if: github.event_name == 'push' diff --git a/gh_release_notes.in b/gh_release_notes.in new file mode 100644 index 000000000..94af63dec --- /dev/null +++ b/gh_release_notes.in @@ -0,0 +1,16 @@ +CICD release artifact + +These builds are created on every merge or push into the [Subsurface repo](http://github.com/subsurface/subsurface). + +This build was created by [merging PR PRNUM ("PRTITLE")](PRURL) and is based on changeset COMMITID ([link](COMMITURL)) + +None of these artifacts are signed with an official key. +The Android APK can be side-loaded on most Android devices. If you had a previous Subsurface-mobile version installed from the Google Play store, you'll have to uninstall that first. +The Windows installer will ask you to confirm installation of an app from an unknown developer. +The macOS DMG makes it even harder with a multi-step dance that requires opening the Privacy & Security settings in the System Preferences and explicitly confirming that you are willing to install this app. + +You can find similar Subsurface-Daily builds for [Ubuntu](https://ppa.launchpadcontent.net/subsurface) and Subsurface-test for [Fedora](https://copr.fedorainfracloud.org/coprs/dirkhh/Subsurface-test). + +**Note:** Due to the asynchronous nature of our build process the artifacts for the individual platforms are added to the release one by one, whenever their build is finished. So if you can not find a particular artifact on a recent (less than 2 hours old) build, please come back later and check again. + +Please report any issues with these builds in the [Subsurface user forum](https://groups.google.com/g/subsurface-divelog). diff --git a/scripts/create-releasenotes.sh b/scripts/create-releasenotes.sh new file mode 100644 index 000000000..8e42604f4 --- /dev/null +++ b/scripts/create-releasenotes.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# use to assemble the details for our release notes and write them to a file +# +# Usage: create-releasenotes.sh pr_num pr_url pr_title commit_id commit_url + +sed "s/PRNUM/$1/;s/PRURL/$2/;s/PRTITLE/$3/;s/COMMITID/$4/;s/COMMITURL/$5/" < gh_release_notes.in > gh_release_notes +