[maven-release-plugin] prepare for next development iteration #11
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: Verify | |
# trigger on push to branches and PR | |
on: | |
push: | |
branches: | |
- '**' # matches every branch | |
tags: | |
- 'project-settings-extension-[0-9]+' | |
- 'project-settings-extension-[0-9]+.[0-9]+' | |
- 'project-settings-extension-[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
jobs: | |
build: | |
name: 'with JDK ${{ matrix.jdk }}' | |
strategy: | |
fail-fast: false | |
matrix: | |
jdk: [ 11, 17 ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '${{ matrix.jdk }}' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build and verify | |
run: ./mvnw verify --batch-mode --no-transfer-progress --errors | |
- name: Dump Settings | |
run: | | |
gpg --version || : | |
gpg --list-keys || : | |
gpg2 --version || : | |
gpg2 --list-keys || : | |
./mvnw -B help:effective-settings -X || : | |
echo "github.repository ${{ github.repository }}" | |
echo "github.ref_protected ${{ github.ref_protected }}" | |
echo "github.ref ${{ github.ref }}" | |
echo "startsWith ${{ startsWith(github.ref, 'refs/tags/project-settings-extension-') }}" | |
echo "all ${{ github.repository == 'gzm55/project-settings-maven-extension' && github.ref_protected && startsWith(github.ref, 'refs/tags/project-settings-extension-') }}" | |
release-on-tag: | |
name: 'Publish tag ${{ github.ref_name }} to the Maven Central Repository' | |
needs: build | |
if: github.repository == 'gzm55/project-settings-maven-extension' && github.ref_protected && startsWith(github.ref, 'refs/tags/project-settings-extension-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name: Dump Settings | |
run: | | |
gpg --version || : | |
gpg --list-keys || : | |
gpg2 --version || : | |
gpg2 --list-keys || : | |
./mvnw -B help:effective-settings -X | |
- name: Publish package | |
run: ./mvnw -B -DskipTests -Dinvoker.skip -gs .cd/settings.xml -P release-profile deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |