Add a GitHub action for the release. #5
Workflow file for this run
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
name: Release | |
on: | |
workflow_dispatch: | |
# temporary | |
pull_request: | |
branches: [ main ] | |
jobs: | |
release-sbt: | |
runs-on: ubuntu-latest | |
name: Release Scala Artifacts | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Scala | |
uses: olafurpg/setup-scala@v14 | |
with: | |
java-version: "adopt@1.8" | |
- name: Import GPG Key | |
shell: bash | |
run: echo "${{ secrets.SONATYPE_GPG_KEY }}" > gpg-secret-key.asc | |
- name: Import GPG Public Key | |
shell: bash | |
run: gpg --import --batch gpg-secret-key.asc && rm -rf gpg-secret-key.asc | |
- name: Setup SonaType config | |
shell: bash | |
run: | | |
mkdir -p ~/.sbt/1.0 | |
echo "${{ secrets.SONATYPE_CONFIG }}" > ~/.sbt/1.0/sonatype.sbt | |
- name: Run the release plugin | |
working-directory: ./pramen | |
run: sbt releaseNow | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: "Release version ${{ steps.release.outputs.version }}" | |
branch: release/${{ steps.release.outputs.version }} | |
title: "Release version ${{ steps.release.outputs.version }}" | |
body: "Automated release created by GitHub Action." | |
token: ${{ secrets.GITHUB_TOKEN }} |