Skip to content

Commit a904e87

Browse files
authored
Update publish pipeline and version management (#20)
1 parent f5aae63 commit a904e87

File tree

8 files changed

+63
-25
lines changed

8 files changed

+63
-25
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ tab_width = 4
1010
[{*.kt,*.kts}]
1111
ij_kotlin_line_break_after_multiline_when_entry = false
1212
ij_kotlin_name_count_to_use_star_import = 5
13-
ij_kotlin_name_count_to_use_star_import_for_members = 3
13+
ij_kotlin_name_count_to_use_star_import_for_members = 3
14+
15+
[*.yml]
16+
indent_size = 2

.github/workflows/publish.yml

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,49 @@
1-
name: Generate m2 packages
1+
name: Publish (m2 + draft)
22
on:
3-
workflow_dispatch:
3+
workflow_dispatch:
44
jobs:
5-
build:
6-
runs-on: macos-latest
7-
steps:
8-
- uses: actions/checkout@v5
9-
- uses: actions/setup-java@v5
10-
with:
11-
distribution: temurin
12-
java-version: 17
13-
- name: Setup Gradle
14-
uses: gradle/gradle-build-action@v3
15-
- name: Execute Gradle build
16-
run: ./gradlew createLocalM2 -PPGP_KEY="${{secrets.PGP_KEY}}" -PPGP_PAS="${{secrets.PGP_PAS}}"
17-
- uses: actions/upload-artifact@v4
18-
with:
19-
name: m2
20-
path: build/m2
21-
if-no-files-found: error
5+
build:
6+
runs-on: macos-latest
7+
permissions:
8+
contents: write
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
12+
steps:
13+
- uses: actions/checkout@v5
14+
- uses: actions/setup-java@v5
15+
with:
16+
distribution: temurin
17+
java-version: 17
18+
19+
- name: Prepare release name
20+
run: |
21+
LEVIATHAN_VERSION=$(grep "leviathan =" gradle/leviathan.toml | cut -d '"' -f 2)
22+
RELEASE_TAG_NAME="release/v$LEVIATHAN_VERSION"
23+
24+
echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME"
25+
echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME" >> $GITHUB_ENV
26+
27+
echo "LEVIATHAN_VERSION=$LEVIATHAN_VERSION"
28+
echo "LEVIATHAN_VERSION=$LEVIATHAN_VERSION" >> $GITHUB_ENV
29+
30+
- name: Execute Gradle build
31+
run: ./gradlew createLocalM2 -PPGP_KEY="${{secrets.PGP_KEY}}" -PPGP_PAS="${{secrets.PGP_PAS}}"
32+
33+
- uses: actions/upload-artifact@v4
34+
with:
35+
name: m2
36+
path: build/m2
37+
if-no-files-found: error
38+
39+
- name: Create zip file for release
40+
run: |
41+
cd build/m2
42+
zip -r m2.zip .
43+
44+
- name: Create draft release
45+
run: |
46+
gh release create "${{ env.RELEASE_TAG_NAME }}" build/m2/m2.zip \
47+
--title "Leviathan ${{ env.LEVIATHAN_VERSION }}" \
48+
--generate-notes \
49+
--draft

.github/workflows/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848

4949
- name: Execute Gradle build
5050
run: ./gradlew detekt
51-
52-
- name: Build leviathan
51+
52+
- name: Build leviathan
5353
run: ./gradlew leviathan:assemble
5454

5555
- name: Build leviathan-compose

gradle/leviathan.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[versions]
2+
leviathan = "2.0.0"

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
agp = "8.12.0"
3-
android-compileSdk = "34"
3+
android-compileSdk = "35"
44
android-minSdk = "21"
55

66
detekt = "1.23.8"

leviathan-compose/build.gradle.kts

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

14-
version = "2.0.0"
14+
version = leviathan.versions.leviathan.get()
1515

1616
kotlin {
1717
explicitApi()

leviathan/build.gradle.kts

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

12-
version = "2.0.0"
12+
version = leviathan.versions.leviathan.get()
1313

1414
kotlin {
1515
explicitApi()

settings.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ dependencyResolutionManagement {
1616
google()
1717
mavenCentral()
1818
}
19+
versionCatalogs {
20+
create("leviathan") {
21+
from(files("gradle/leviathan.toml"))
22+
}
23+
}
1924
}
2025

2126
include(":leviathan")

0 commit comments

Comments
 (0)