Create Maven Release #42
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: Create Maven Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version number" | |
jobs: | |
maven-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
server-id: 'github' # Value of the distributionManagement/repository/id field of the pom.xml | |
# - name: Create settings | |
# run: echo "<settings><interactiveMode>false</interactiveMode><profiles/><servers><server><id>github</id><configuration><httpHeaders><property><name>Authorization</name><value>Bearer ${{ secrets.GITHUB_TOKEN }}</value></property></httpHeaders></configuration></server></servers><mirrors /></settings>" > /home/runner/.m2/settings.xml | |
- name: Check maven | |
run: java -version && mvn -version && cat /home/runner/.m2/settings.xml | |
- name: Check inputs | |
run: | | |
[[ "${{ inputs.version }}" ]] || { echo "version input is empty" ; exit 1; } | |
shell: bash | |
- name: Configure Git user | |
run: | | |
git config user.email "actions@github.com" | |
git config user.name "GitHub Actions" | |
- name: Release with maven | |
run: mvn -q -DskipTests -Dmaven.test.skip=true -B -Dresume=false release:prepare release:perform -Darguments=-DskipTests -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.site.deploy.skip=true -DreleaseVersion=${{ inputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |