Publish to GitHub Maven Repository #342
Workflow file for this run
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 to GitHub Maven Repository | |
| on: workflow_dispatch | |
| jobs: | |
| release: | |
| name: SBT Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| if: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags') && always() }} | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - uses: actions/checkout@v4 | |
| if: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) && always() }} | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Scala | |
| uses: japgolly/setup-everything-scala@v3.1 | |
| with: | |
| java-version: temurin:1.23.0.1 | |
| - name: Prepare release command | |
| shell: bash | |
| run: | |
| releaseVersion=$(git describe --tags --abbrev=7) | |
| rvn="${releaseVersion:1}" | |
| commandText="release release-version $rvn next-version $rvn-SNAPSHOT" | |
| echo "command=$commandText" >> "$GITHUB_OUTPUT" | |
| id: release_command | |
| - name: Release new version | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.MAVEN_PUBLISH_TOKEN }} | |
| run: | | |
| sbt '${{ steps.release_command.outputs.command }}' |