Publish #17
This file contains hidden or 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
| name: Publish | |
| on: | |
| # release: | |
| # We'll run this workflow when a new GitHub release is created | |
| # types: [released] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version eg v1.0.0' | |
| required: true | |
| type: string | |
| jobs: | |
| publish: | |
| name: Release build and publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: adopt | |
| java-version: 17 | |
| - name: Grant Gradlew rights | |
| run: chmod +x gradlew | |
| # Builds the release artifacts of the library | |
| - name: Release build | |
| run: ./gradlew :speld:assembleRelease | |
| - name: Publish Library | |
| run: | | |
| echo "Publishing library🚀" | |
| ./gradlew publish --no-daemon --no-parallel | |
| echo "Published ✅" | |
| echo "Releasing repository...🚀" | |
| ./gradlew releaseRepository | |
| echo "Released ✅" | |
| env: | |
| ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.version }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME_NEW }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD_NEW }} | |
| - name: Git push tag | |
| run: | | |
| git tag -a ${{ github.event.inputs.version }} -m "Release version ${{ github.event.inputs.version }}" | |
| git push origin ${{ github.event.inputs.version }} | |
| - name: Create Release | |
| uses: ncipollo/release-action@v1.16.0 | |
| with: | |
| tag: "${{ github.event.inputs.version }}" | |
| generateReleaseNotes: true | |
| commit: "master" | |
| makeLatest: true |