Deploy a branch as a snapshot version. #45
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: Deploy a branch as a snapshot version. | |
on: | |
workflow_dispatch: | |
inputs: | |
run-tests: | |
type: boolean | |
description: Run tests | |
default: true | |
# Cancel previous jobs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy-branch: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
architecture: x64 | |
cache: maven | |
server-id: ossrh | |
server-username: CI_DEPLOY_USERNAME | |
server-password: CI_DEPLOY_PASSWORD | |
gpg-private-key: ${{ secrets.RUNE_GPG_PRIVATE_KEY }} | |
gpg-passphrase: GPG_PASSPHRASE | |
- name: Normalize branch name | |
id: normalize-branch-name | |
uses: ./.github/actions/normalize-branch-name | |
- name: Set version | |
run: mvn -B versions:set -DgenerateBackupPoms=false -DnewVersion=0.0.0.${{ steps.normalize-branch-name.outputs.normalized }}-SNAPSHOT | |
- uses: ./.github/actions/maven-build | |
with: | |
build-command: deploy | |
run-tests: ${{ inputs.run-tests }} | |
env: | |
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} | |
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} |