-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fba2ee
commit 9dfc866
Showing
6 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Publish to Snapshots OSSRH Sonartype | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
publish: | ||
name: Publish Snapshot Artifacts | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set Short ID | ||
id: set_short_id | ||
run: | | ||
SHORT_ID=$(openssl rand -hex 5) | ||
echo "UNIQUE_ID=$SHORT_ID" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
# Step 1 | ||
# This is optional and only if you want to set the timezone | ||
- name: Setup timezone | ||
run: | | ||
sudo timedatectl set-timezone Europe/Berlin | ||
timedatectl | ||
# Step 2 | ||
# Required step | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
# Step 3 | ||
# Optional step | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
# Step 4 | ||
# Required step | ||
- name: Set up Java 17 JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
architecture: x64 | ||
cache: 'gradle' | ||
check-latest: true | ||
|
||
# Step 5 | ||
# Optional step, but recommended as user often commit the gradle wrapper jar without execute permissions. | ||
- name: Change wrapper permissions | ||
run: chmod +x ./gradlew | ||
|
||
# Step 6 | ||
# Required step | ||
- name: Decode GPG Key | ||
run: | | ||
mkdir -p ~/.gradle/ | ||
echo "${{secrets.OSSRH_GPG_SECRET_KEY}}" > ~/.gradle/secring.gpg.b64 | ||
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg | ||
# Step 7 | ||
# Obviously required step | ||
- name: Publish package | ||
# wrapped the signing.password with single quotes as the password could contain special characters | ||
run: ./gradlew publish -Psigning.keyId='${{secrets.OSSRH_GPG_SECRET_KEY_ID}}' -Psigning.password='${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}}' -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) --warn --stacktrace | ||
env: | ||
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}} | ||
OSSRH_PASSWORD: ${{secrets.OSSRH_TOKEN}} | ||
OSSRH_URL: "https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
PUBLISH_TYPE: "SNAPSHOT" | ||
|
||
# Step 8 | ||
# Optional step, will enable you to see what you have released as well here on GitHub | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: release-build-libs | ||
path: build/libs | ||
retention-days: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters