Cleanup and fix for issue related to perms when running create_release
#3
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: Maven Package | |
on: | |
push: | |
tags: | |
- 'v[0-9][0-9]?.[0-9][0-9]?.[0-9][0-9]?' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
cache: maven | |
- name: Generate changelog | |
id: changelog | |
uses: mikepenz/release-changelog-builder-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
configuration: "{ | |
\"categories\": [ | |
{ | |
\"title\": \"Commits\", | |
\"labels\": [\"*\"] | |
} | |
], | |
\"ignore_labels\": [\"skip-changelog\"], | |
\"pull_request_format\": \"{{title}}\", | |
\"commit_format\": \"{{message}}\"}" | |
- name: Create release | |
id: create_release | |
if: github.event_name == 'push' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: | | |
Changes in this Release | |
- ${{ steps.changelog.outputs.changelog }} | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml --settings $GITHUB_WORKSPACE/settings.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to GitHub Packages Apache Maven | |
run: mvn deploy --settings $GITHUB_WORKSPACE/settings.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |