Merge pull request #99 from CheckmarxDev/dependabot/maven/org.apache.… #6
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 Creation | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Cache local Maven repository | |
uses: actions/[email protected] | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Update the POM version. | |
run: mvn -B versions:set -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml -DskipTests | |
- name: Publish package | |
run: mvn --batch-mode deploy -DskipTests | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
name: ${{ env.RELEASE_VERSION }} | |
generate_release_notes: true |