Skip to content

Commit 54a00ce

Browse files
committed
Add GitHub Actions for publish
1 parent fd60e35 commit 54a00ce

6 files changed

Lines changed: 81 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Product Deploy
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
Publishing:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Env
18+
run: |
19+
VERSION_NAME=$(grep "versionName" ./version.properties | cut -d "=" -f 2)
20+
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
21+
22+
echo '${{ secrets.PUBLISH_PROPERTIES }}' | openssl base64 -d -out ./publish.properties
23+
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '17'
28+
distribution: 'temurin'
29+
cache: gradle
30+
31+
- name: Set up Android SDK (Only on Act)
32+
if: success() && ${{ env.ACT }}
33+
uses: android-actions/setup-android@v3
34+
35+
- name: Publish
36+
run: ./gradlew publish
37+
38+
- name: Release
39+
uses: ncipollo/release-action@v1
40+
with:
41+
tag: v${{ env.VERSION_NAME }}
42+
allowUpdates: true
43+
generateReleaseNotes: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
.externalNativeBuild
1414
.cxx
1515
local.properties
16-
publish.properties
16+
publish.properties
17+
/act

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue Jul 30 00:34:18 KST 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

version-migrator/build.gradle.kts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,25 @@ android {
3131
}
3232

3333
publishing {
34-
val properties = loadProperties(
34+
val publishProperties = loadProperties(
3535
rootProject.file("publish.properties").path
3636
)
37+
val versionProperties = loadProperties(
38+
rootProject.file("version.properties").path
39+
)
3740
repositories {
38-
maven(properties["githubRepoUrl"].toString()) {
41+
maven(publishProperties["githubRepoUrl"].toString()) {
3942
credentials {
40-
username = properties["githubUserName"].toString()
41-
password = properties["githubToken"].toString()
43+
username = publishProperties["githubUserName"].toString()
44+
password = publishProperties["githubToken"].toString()
4245
}
4346
}
4447
}
4548
publications {
4649
register<MavenPublication>(name) {
47-
groupId = properties["groupId"].toString()
48-
artifactId = properties["artifactId"].toString()
49-
version = properties["versionName"].toString()
50+
groupId = publishProperties["groupId"].toString()
51+
artifactId = publishProperties["artifactId"].toString()
52+
version = versionProperties["versionName"].toString()
5053

5154
afterEvaluate {
5255
from(components["release"])

version.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
versionName=1.0.1

0 commit comments

Comments
 (0)