Skip to content

Commit 41901f2

Browse files
committed
ci: Simplify release workflow
1 parent f70c1fa commit 41901f2

File tree

2 files changed

+66
-69
lines changed

2 files changed

+66
-69
lines changed

.github/workflows/prep_release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Prepare Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version number (e.g., 1.4.0)'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
prepare-release:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v5
21+
22+
- name: Setup Java
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: 17
26+
distribution: 'adopt'
27+
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@v4
30+
31+
- name: Update versionName in build.gradle.kts
32+
run: |
33+
VERSION="${{ inputs.version }}"
34+
sed -i "s/versionName = \".*\"/versionName = \"$VERSION\"/" app/build.gradle.kts
35+
36+
- name: Run changelogMD task
37+
run: ./gradlew changelogMD
38+
39+
- name: Run fastlaneChangelog task
40+
run: ./gradlew fastlaneChangelog
41+
42+
- name: Create Pull Request
43+
uses: peter-evans/create-pull-request@v7
44+
with:
45+
branch: release/${{ inputs.version }}
46+
labels: release
47+
commit-message: "chore: prepare release ${{ inputs.version }}"
48+
title: "chore: release ${{ inputs.version }}"
49+
body: |
50+
This PR prepares the release for version ${{ inputs.version }}.
51+
52+
Changes:
53+
- Updated versionName in build.gradle.kts
54+
- Updated CHANGELOG.md
55+
- Created Fastlane changelog file
56+
57+
Once merged, this will trigger the build and publish workflow.

.github/workflows/create_release.yml renamed to .github/workflows/release.yml

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,13 @@
1-
name: Create Release
1+
name: Release
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
version:
7-
description: 'Version number (e.g., 1.4.0)'
8-
required: true
9-
type: string
104
pull_request:
115
types:
126
- closed
137
branches:
148
- main
159

1610
jobs:
17-
prepare-release:
18-
if: github.event_name == 'workflow_dispatch'
19-
runs-on: ubuntu-latest
20-
permissions:
21-
contents: write
22-
pull-requests: write
23-
24-
steps:
25-
- name: Check out repository
26-
uses: actions/checkout@v5
27-
with:
28-
token: ${{ secrets.GITHUB_TOKEN }}
29-
30-
- name: Setup Java
31-
uses: actions/setup-java@v4
32-
with:
33-
java-version: 17
34-
distribution: 'adopt'
35-
36-
- name: Setup Gradle
37-
uses: gradle/actions/setup-gradle@v4
38-
39-
- name: Update versionName in build.gradle.kts
40-
run: |
41-
VERSION="${{ inputs.version }}"
42-
sed -i "s/versionName = \".*\"/versionName = \"$VERSION\"/" app/build.gradle.kts
43-
44-
- name: Run changelogMD task
45-
run: ./gradlew changelogMD
46-
47-
- name: Run fastlaneChangelog task
48-
run: ./gradlew fastlaneChangelog
49-
50-
- name: Create Pull Request
51-
uses: peter-evans/create-pull-request@v7
52-
with:
53-
token: ${{ secrets.GITHUB_TOKEN }}
54-
branch: release/${{ inputs.version }}
55-
title: "chore: release ${{ inputs.version }}"
56-
body: |
57-
This PR prepares the release for version ${{ inputs.version }}.
58-
59-
Changes:
60-
- Updated versionName in build.gradle.kts
61-
- Updated CHANGELOG.md
62-
- Created Fastlane changelog file
63-
64-
Once merged, this will trigger the build and publish workflow.
65-
commit-message: "chore: prepare release ${{ inputs.version }}"
66-
delete-branch: true
67-
labels: |
68-
release
69-
7011
build-and-publish:
7112
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
7213
runs-on: ubuntu-latest
@@ -75,7 +16,7 @@ jobs:
7516
packages: write
7617

7718
steps:
78-
- name: Check out repository
19+
- name: Checkout repository
7920
uses: actions/checkout@v5
8021

8122
- name: Setup Java
@@ -92,10 +33,9 @@ jobs:
9233
run: |
9334
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
9435
VERSION="${BRANCH_NAME#release/}"
95-
echo "version=$VERSION" >> $GITHUB_OUTPUT
9636
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
9737
98-
- name: Build Release AAB
38+
- name: Build release AAB
9939
run: ./gradlew bundleRelease
10040

10141
- uses: r0adkll/sign-android-release@v1
@@ -106,11 +46,11 @@ jobs:
10646
with:
10747
releaseDirectory: app/build/outputs/bundle/release
10848
signingKeyBase64: ${{ secrets.KEY_BASE64 }}
109-
alias: ${{ secrets.KEY_ALIAS }}
11049
keyStorePassword: ${{ secrets.STORE_PASS }}
50+
alias: ${{ secrets.KEY_ALIAS }}
11151
keyPassword: ${{ secrets.KEY_PASS }}
11252

113-
- name: Build Release APK
53+
- name: Build release APK
11454
run: ./gradlew assembleRelease
11555

11656
- name: Signing APK
@@ -121,15 +61,15 @@ jobs:
12161
with:
12262
releaseDirectory: app/build/outputs/apk/release
12363
signingKeyBase64: ${{ secrets.KEY_BASE64 }}
124-
alias: ${{ secrets.KEY_ALIAS }}
12564
keyStorePassword: ${{ secrets.STORE_PASS }}
65+
alias: ${{ secrets.KEY_ALIAS }}
12666
keyPassword: ${{ secrets.KEY_PASS }}
12767

128-
- name: Read Changelog
68+
- name: Read changelog
12969
id: read_changelog
130-
run: echo "changelog<<EOF" >> $GITHUB_OUTPUT && bash changelog.sh ${{ steps.extract_version.outputs.version }} >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
70+
run: echo "changelog<<EOF" >> $GITHUB_OUTPUT && bash changelog.sh ${{ steps.extract_version.outputs.tag }} >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
13171

132-
- name: Create Release
72+
- name: Create release
13373
uses: softprops/action-gh-release@v2
13474
with:
13575
tag_name: ${{ steps.extract_version.outputs.tag }}

0 commit comments

Comments
 (0)