Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GHA for publishing #128

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/publish-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish Releases

on:
push:
tags: ["**"]

jobs:
# Run Gradle Wrapper Validation to verify the wrapper's checksum
gradle-validation:
name: Gradle Wrapper
runs-on: ubuntu-latest
if: github.repository_owner == 'taymyr'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# we don't know what commit the last tag was
fetch-depth: 0

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1

publish-artifacts:
name: Publish Artifacts for Scala ${{ matrix.scala }}
runs-on: ubuntu-latest
if: github.repository_owner == 'taymyr'
needs: gradle-validation
strategy:
matrix:
include:
- scala: "2.11"
lagom: "1.4.15"
- scala: "2.12"
lagom: "1.5.5"
- scala: "2.13"
lagom: "1.6.4"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# we don't know what commit the last tag was
fetch-depth: 0
- run: git fetch --tags --force origin # WA: https://github.com/actions/checkout/issues/882

- uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: '8'
check-latest: true
cache: 'gradle'
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Publish Releases
run: >-
./gradlew --no-daemon version publishToSonatype closeAndReleaseSonatypeStagingRepository -x test
-PscalaBinaryVersion=${{ matrix.scala }} -PlagomVersion=${{ matrix.lagom }}
-Psigning.gnupg.keyName=$GPG_KEY_ID
-Psigning.gnupg.passphrase="$GPG_PASSPHRASE"
-PsonatypeUsername="$OSSRH_USERNAME"
-PsonatypePassword="$OSSRH_TOKEN"
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/publish-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish Snapshots

on:
push:
branches:
- master

jobs:
# Run Gradle Wrapper Validation to verify the wrapper's checksum
gradle-validation:
name: Gradle Wrapper
runs-on: ubuntu-latest
if: github.repository_owner == 'taymyr'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# we don't know what commit the last tag was
fetch-depth: 0

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1

publish-artifacts:
name: Publish Artifacts for Scala ${{ matrix.scala }}
runs-on: ubuntu-latest
if: github.repository_owner == 'taymyr'
needs: gradle-validation
strategy:
matrix:
include:
- scala: "2.11"
lagom: "1.4.15"
- scala: "2.12"
lagom: "1.5.5"
- scala: "2.13"
lagom: "1.6.4"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# we don't know what commit the last tag was
fetch-depth: 0

- uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: '8'
check-latest: true
cache: 'gradle'
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Publish Snapshots
run: >-
./gradlew --no-daemon version publishToSonatype -x test
-PscalaBinaryVersion=${{ matrix.scala }} -PlagomVersion=${{ matrix.lagom }}
-Psigning.gnupg.keyName=$GPG_KEY_ID
-Psigning.gnupg.passphrase="$GPG_PASSPHRASE"
-PsonatypeUsername="$OSSRH_USERNAME"
-PsonatypePassword="$OSSRH_TOKEN"
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

22 changes: 0 additions & 22 deletions bin/publish-release

This file was deleted.

22 changes: 0 additions & 22 deletions bin/publish-snapshots

This file was deleted.

14 changes: 0 additions & 14 deletions bin/scriptLib

This file was deleted.

1 change: 1 addition & 0 deletions java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ publishing {
}

signing {
useGpgCmd()
isRequired = isReleaseVersion
sign(publishing.publications["maven"])
}