Skip to content

Commit bc49044

Browse files
authored
Enhance release workflow to automatically create draft releases with changelog (#232)
1 parent bbe4014 commit bc49044

File tree

6 files changed

+31
-12
lines changed

6 files changed

+31
-12
lines changed

.github/workflows/publish.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,40 @@ on:
44
jobs:
55
build:
66
runs-on: macos-latest
7+
permissions:
8+
contents: write
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
712
steps:
813
- uses: actions/checkout@v5
914
- uses: actions/setup-java@v5
1015
with:
1116
distribution: temurin
1217
java-version: 17
13-
- uses: gradle/actions/setup-gradle@v4
18+
19+
- name: Prepare release name
20+
run: |
21+
TIAMAT_VERSION=$(grep "tiamat =" gradle/tiamat.toml | cut -d '"' -f 2)
22+
RELEASE_TAG_NAME="release/v$TIAMAT_VERSION"
23+
24+
echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME"
25+
echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME" >> $GITHUB_ENV
26+
1427
- name: Execute Gradle build
1528
run: ./gradlew createLocalM2 -PPGP_KEY="${{secrets.PGP_KEY}}" -PPGP_PAS="${{secrets.PGP_PAS}}"
29+
1630
- uses: actions/upload-artifact@v4
1731
with:
1832
name: m2
1933
path: build/m2
20-
if-no-files-found: error
34+
if-no-files-found: error
35+
36+
- name: Create zip file for release
37+
run: |
38+
cd build
39+
zip -r m2.zip m2/
40+
41+
- name: Create draft release
42+
run: |
43+
gh release create ${{ env.RELEASE_TAG_NAME }} build/m2.zip --generate-notes --draft

gradle/tiamat.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
[versions]
2-
tiamat-core = "2.0.0-alpha03"
3-
tiamat-destinations = "2.0.0-alpha03"
4-
5-
# [metadata]
6-
# metadata = "some metadata"
2+
tiamat = "2.0.0-alpha03"

tiamat-destinations/compiler-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
alias(libs.plugins.m2p)
44
}
55

6-
version = tiamat.versions.tiamat.destinations.get()
6+
version = tiamat.versions.tiamat.get()
77
group = "io.github.composegears"
88

99
dependencies {

tiamat-destinations/gradle-plugin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
alias(libs.plugins.m2p)
66
}
77

8-
version = tiamat.versions.tiamat.destinations.get()
8+
version = tiamat.versions.tiamat.get()
99
group = "io.github.composegears"
1010

1111
dependencies {
@@ -23,7 +23,7 @@ gradlePlugin {
2323

2424
buildConfig {
2525
packageName("com.composegears.tiamat.destinations")
26-
buildConfigField<String>("COMPILER_PLUGIN_VERSION", tiamat.versions.tiamat.destinations.get())
26+
buildConfigField<String>("COMPILER_PLUGIN_VERSION", tiamat.versions.tiamat.get())
2727

2828
useKotlinOutput()
2929
}

tiamat-destinations/tiamat-destinations/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
alias(libs.plugins.m2p)
1111
}
1212

13-
version = tiamat.versions.tiamat.destinations.get()
13+
version = tiamat.versions.tiamat.get()
1414
group = "io.github.composegears"
1515

1616
kotlin {

tiamat/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
alias(libs.plugins.m2p)
1111
}
1212

13-
version = tiamat.versions.tiamat.core.get()
13+
version = tiamat.versions.tiamat.get()
1414
group = "io.github.composegears"
1515

1616
kotlin {

0 commit comments

Comments
 (0)