Skip to content

Instantly share code, notes, and snippets.

@prdoyle
Created November 4, 2022 11:44
Show Gist options
  • Save prdoyle/1487624db8252a399901b60c230f77ad to your computer and use it in GitHub Desktop.
Save prdoyle/1487624db8252a399901b60c230f77ad to your computer and use it in GitHub Desktop.
WIP GitHub action for Gradle Sonatype release
# Originally from https://github.com/testcontainers/testcontainers-java/blob/de20484e53eb8d1f580b74ff9df31261b596ab5c/.github/workflows/release.yml#L1
name: Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: temurin
- name: Clear existing docker image cache
run: docker image prune -af
- name: Setup Gradle Build Action
uses: gradle/gradle-build-action@v2
- name: Run Gradle Build
run: ./gradlew build --no-daemon -i -x test
- name: Run Gradle Publish
run: |
./gradlew publish \
-Pversion="${{github.event.release.tag_name}}" --no-daemon -i
env:
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment