From 5d5b8492ab9a080181bffe285d705442f0fd6aee Mon Sep 17 00:00:00 2001 From: currand Date: Mon, 22 Sep 2025 16:45:58 -0400 Subject: [PATCH 1/4] Create release.yml --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9cc3c2e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release Build + +on: + workflow_dispatch: + push: + branches: [ "master" ] + tags: [ "*[0-9]-release" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Extract tag name + if: startsWith(github.ref, 'refs/tags/') + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Set up environment variables + run: | + echo "GPR_USER=${{ github.actor }}" >> $GITHUB_ENV + echo "GPR_KEY=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> $GITHUB_ENV + echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> $GITHUB_ENV + echo "KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> $GITHUB_ENV + echo "KEYSTORE_BASE64=${{ secrets.KEYSTORE_BASE64 }}" >> $GITHUB_ENV + echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - name: set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build + + - name: Archive APK + uses: actions/upload-artifact@v4 + with: + name: app-release.apk + path: app/build/outputs/apk/release/app-release.apk + + - name: Create Release + id: create_release + uses: ncipollo/release-action@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + name: ${{ github.ref_name }} + prerelease: false + generateReleaseNotes: true + artifacts: app/build/outputs/apk/release/app-release.apk, app/manifest.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 6e3a70bb96c83115d8435f3a93ace53de2b705fc Mon Sep 17 00:00:00 2001 From: currand Date: Mon, 22 Sep 2025 16:51:00 -0400 Subject: [PATCH 2/4] Create pre-release.yml --- .github/workflows/pre-release.yml | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/pre-release.yml diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..4264da5 --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,57 @@ +name: Pre-Release Build + +on: + workflow_dispatch: + push: + branches-ignore: [ "master" ] + branches: ["*"] + tags: [ "*-pre-release" ] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Extract tag name + if: startsWith(github.ref, 'refs/tags/') + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Set up environment variables + run: | + echo "GPR_USER=${{ github.actor }}" >> $GITHUB_ENV + echo "GPR_KEY=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> $GITHUB_ENV + echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> $GITHUB_ENV + echo "KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> $GITHUB_ENV + echo "KEYSTORE_BASE64=${{ secrets.KEYSTORE_BASE64 }}" >> $GITHUB_ENV + echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - name: set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build + + - name: Archive APK + uses: actions/upload-artifact@v4 + with: + name: app-release.apk + path: app/build/outputs/apk/release/app-release.apk + + - name: Create Release + id: create_release + uses: ncipollo/release-action@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + name: ${{ github.ref_name }} + prerelease: true + generateReleaseNotes: true + artifacts: app/build/outputs/apk/release/app-release.apk, app/manifest.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9912f639fd3f5b35c88559679a169e201ba88dcc Mon Sep 17 00:00:00 2001 From: currand Date: Mon, 22 Sep 2025 16:52:49 -0400 Subject: [PATCH 3/4] Create release-comments.yml --- .github/workflows/release-comments.yml | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/release-comments.yml diff --git a/.github/workflows/release-comments.yml b/.github/workflows/release-comments.yml new file mode 100644 index 0000000..41394a7 --- /dev/null +++ b/.github/workflows/release-comments.yml @@ -0,0 +1,57 @@ +name: Comment on Fixed Issues/PRs on Release + +on: + push: + tags: + - '*[0-9]-release' + workflow_dispatch: + inputs: + tag: + description: 'Tag to run the workflow for' + required: false + default: '' + +jobs: + comment-on-fixed: + runs-on: ubuntu-latest + permissions: + pull-requests: write + issues: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + - name: Find closed issues/PRs and comment + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Use the input tag if provided, otherwise use the tag from the push event + if [ -n "${{ github.event.inputs.tag }}" ]; then + RELEASE_TAG="${{ github.event.inputs.tag }}" + else + RELEASE_TAG="${{ github.ref }}" + # Remove the 'refs/tags/' part to get the tag name + RELEASE_TAG="${RELEASE_TAG#refs/tags/}" + fi + + # Get the previous tag. If there is no previous tag, this will be empty. + PREVIOUS_TAG=$(git tag --sort=-v:refname | grep -v "$RELEASE_TAG" | head -n 1) + + # Get the commit range + if [ -z "$PREVIOUS_TAG" ]; then + # If there is no previous tag, get all commits up to the current tag + COMMIT_RANGE="$RELEASE_TAG" + else + COMMIT_RANGE="$PREVIOUS_TAG..$RELEASE_TAG" + fi + + # Find the commits in this release + COMMITS=$(git log "$COMMIT_RANGE" --pretty=format:"%B") + + # Extract issues/PRs closed (simple regex, can be improved) + echo "$COMMITS" | grep -oE "#[0-9]+" | sort -u | while read ISSUE; do + ISSUE_NUMBER="${ISSUE//#/}" + COMMENT="This issue/pr has been fixed in release ${RELEASE_TAG} :tada:" + gh issue comment "$ISSUE_NUMBER" --body "$COMMENT" + done + shell: bash From 1889de8d908e355f3d25c89b03f513b1963de38a Mon Sep 17 00:00:00 2001 From: currand Date: Mon, 22 Sep 2025 16:53:41 -0400 Subject: [PATCH 4/4] Update pre-release.yml --- .github/workflows/pre-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 4264da5..e3cf9b3 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -4,7 +4,6 @@ on: workflow_dispatch: push: branches-ignore: [ "master" ] - branches: ["*"] tags: [ "*-pre-release" ] jobs: