Skip to content

Commit bbf7883

Browse files
committed
ci: update workflows
1 parent 5326180 commit bbf7883

File tree

5 files changed

+295
-13
lines changed

5 files changed

+295
-13
lines changed

.github/workflows/main.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Publish Snapshot
2929
run: |
3030
chmod +x ./publish_snapshot.sh
31-
./publish_snapshot.sh ${{secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME}} ${{secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD}}
31+
./publish_snapshot.sh ${{secrets.SONATYPE_NEXUS_USERNAME}} ${{secrets.SONATYPE_NEXUS_PASSWORD}}
3232
3333
update_draft_release:
3434
name: Create or Update Draft Release
@@ -52,10 +52,12 @@ jobs:
5252
run: |
5353
PROPERTIES="$(./gradlew properties --console=plain -q)"
5454
VERSION="$(echo "$PROPERTIES" | grep "^VERSION_NAME:" | cut -f2- -d ' ')"
55-
chmod +x ./get_changelog.sh
56-
CHANGELOG="$(./get_changelog.sh $VERSION)"
55+
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
5756
echo "version=$VERSION" >> $GITHUB_OUTPUT
58-
echo "changelog=$(echo "$CHANGELOG" | base64 )" >> $GITHUB_OUTPUT
57+
58+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
59+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
60+
echo "EOF" >> $GITHUB_OUTPUT
5961
6062
# Remove old release drafts by using the curl request for the available releases with a draft flag
6163
- name: Remove Old Release Drafts
@@ -74,4 +76,4 @@ jobs:
7476
gh release create v${{ steps.properties.outputs.version }} \
7577
--draft \
7678
--title "v${{ steps.properties.outputs.version }}" \
77-
--notes "$(echo "${{ steps.properties.outputs.changelog }}" | base64 --decode)"
79+
--notes "$(echo "${{ steps.properties.outputs.changelog }}")"

.github/workflows/publish.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Publish Artifacts to Maven Central
22
on:
33
release:
4-
types: [ created ]
4+
types: [ released ]
5+
workflow_dispatch:
6+
57
jobs:
68
publish:
79
runs-on: ubuntu-latest
@@ -14,6 +16,11 @@ jobs:
1416
java-version: 17
1517

1618
- name: publish to maven central
19+
env:
20+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
21+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
22+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
23+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
1724
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
1825

1926

.github/workflows/verify.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
run: ./gradlew detekt
2626

2727
- name: Run Tests
28-
run: ./gradlew test
28+
run: ./gradlew testDebug

.idea/other.xml

+274
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Android Library Template
1+
# Android Library Template
22

33
This is a template for creating Android Open Source libraries. This template features
44

@@ -28,11 +28,10 @@ This is a template for creating Android Open Source libraries. This template fea
2828
1. Click on the `Use this template` button to create a new repository from this template.
2929
2. Update the `gradle.properties` files with the correct values for your library.
3030
3. Add following secrets to your repository to enable publishing to Maven Central (For more information about following properties, please refer to [Gradle Maven Publish Plugin](https://vanniktech.github.io/gradle-maven-publish-plugin/central/))
31-
- `ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD` - Your Maven Central password
32-
- `ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME` - Your Maven Central username
33-
- `ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY` - Your GPG key
34-
- `ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD` - Your GPG key password
35-
- `ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID` - Your GPG key ID
31+
- `SIGNING_PASSWORD` - Password for the GPG key
32+
- `SIGNING_PRIVATE_KEY` - GPG key
33+
- `SONATYPE_NEXUS_USERNAME` - Sonatype username
34+
- `SONATYPE_NEXUS_PASSWORD` - Sonatype password
3635

3736

3837
## Branching Strategy

0 commit comments

Comments
 (0)