Skip to content

Commit 9cee720

Browse files
authored
Merge pull request #60 from yml-org/feature/980
publish.yml
2 parents 09544bd + 8b65123 commit 9cee720

File tree

3 files changed

+72
-6
lines changed

3 files changed

+72
-6
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## :loudspeaker: Type of change
2+
<!--- Put an `x` in the boxes that apply, remove checkboxes from remaining -->
3+
4+
- [ ] Bugfix
5+
- [ ] New feature
6+
- [ ] Enhancement
7+
- [ ] Refactoring
8+
9+
## :scroll: Description
10+
<!--- Describe your changes in detail -->
11+
12+
## :bulb: Motivation and Context
13+
<!--- Why is this change required? What problem does it solve? -->
14+
<!--- If it fixes an open issue, please link to the issue here. -->
15+
16+
## :green_heart: How did you test it?
17+
<!--- Describe how the changes were tested -->
18+
19+
## :pencil: Checklist
20+
<!--- Put an `x` in the boxes that apply, remove checkboxes from remaining -->
21+
22+
- [ ] I reviewed submitted code
23+
- [ ] I added tests to verify changes
24+
- [ ] All tests passing
25+
- [ ] All linters passing
26+
- [ ] There are no code climate issues
27+
28+
## :crystal_ball: Next steps
29+
<!--- Describe any changes that need to be made after merging this PR -->
30+
<!--- Describe any changes that you would like to make after merging this PR -->
31+
32+
## :camera_flash: Screenshots / GIFs
33+
<!--- Mandatory for UI changes -->
34+
<!-- Uncomment the next line and replace it with links to your screenshots. -->
35+
<!--
36+
<img src="https://placekitten.com/260/260" width="260">&emsp;
37+
<img src="https://placekitten.com/300/300" width="260">&emsp;
38+

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Maven Release
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Java for publishing to Maven Central Repository
12+
uses: actions/setup-java@v3
13+
with:
14+
java-version: '11'
15+
distribution: 'temurin'
16+
cache: gradle
17+
18+
- name: Grant execute permission for gradlew
19+
run: chmod +x gradlew
20+
- name: Build with Gradle
21+
run: ./gradlew :YChartsLib:clean build publish
22+
23+
env:
24+
MAVEN_USERNAME: ${{ secrets.MAVENCENTRALUSERNAME }}
25+
MAVEN_PASSWORD: ${{ secrets.MAVENCENTRALPASSWORD}}
26+
MEMORY_KEY: ${{ secrets.SIGNINGINMEMORYKEY}}
27+
SIGNINGKEY: ${{ secrets.SIGNINGKEYID}}
28+
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD}}

YChartsLib/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ publishing {
8383
name = "YCharts"
8484
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
8585
credentials {
86-
username = project.findProperty("mavenCentralUsername").toString()
87-
password = project.findProperty("mavenCentralPassword").toString()
86+
username = project.findProperty("mavenCentralUsername")?.toString() ?: System.getenv("MAVEN_USERNAME")
87+
password = project.findProperty("mavenCentralPassword")?.toString() ?: System.getenv("MAVEN_PASSWORD")
8888
}
8989
}
9090
}
9191
publications {
9292
register<MavenPublication>("release") {
9393
groupId = "co.yml"
9494
artifactId = "ycharts"
95-
version = "1.0.0"
95+
version = "1.0.1"
9696
afterEvaluate {
9797
from(components["release"])
9898
}
@@ -138,9 +138,9 @@ publishing {
138138

139139
signing {
140140
useInMemoryPgpKeys(
141-
project.findProperty("signing.keyId").toString(),
142-
project.findProperty("signing.InMemoryKey").toString(),
143-
project.findProperty("signing.password").toString()
141+
project.findProperty("signing.keyId")?.toString() ?: System.getenv("SIGNINGKEY"),
142+
project.findProperty("signing.InMemoryKey")?.toString() ?: System.getenv("MEMORY_KEY"),
143+
project.findProperty("signing.password")?.toString()?:System.getenv("SIGNINGPASSWORD")
144144
)
145145
sign(publishing.publications)
146146
}

0 commit comments

Comments
 (0)