Remove outdated and not that useful comment #1
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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: ['8', '11', '17','21'] | |
if: github.repository_owner == 'openhtmltopdf' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{matrix.java}} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{matrix.java}} | |
cache: maven | |
- name: Maven -v | |
run: mvn -v | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml -Drevision=${{ github.sha }} | |
release: | |
name: Create release | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Step 1 - Checkout code | |
uses: actions/checkout@v4 | |
- name: Step 2 - Import GPG key | |
run: | | |
echo "${{ secrets.GPG_PUBLIC_KEY }}" | gpg --import | |
echo "${{ secrets.GPG_SECRET_KEY }}" | gpg --import --no-tty --batch --yes | |
- name: Step 3 - Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 8 | |
cache: maven | |
- name: Step 4 - Get next version | |
uses: reecetech/version-increment@2023.9.3 | |
id: version | |
with: | |
scheme: semver | |
increment: patch | |
- name: Step 5 - Prepare and perform release | |
run: mvn -B deploy --no-transfer-progress -e -Prelease -Drevision=${{ steps.version.outputs.version }} -s settings.xml | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Step 6 - Upload artifact to GitHub Package Registry | |
run: mvn -B deploy -Dgithub-release -Drevision=${{ steps.version.outputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Step 7 - Push Git tag for the new release | |
uses: rickstaa/action-create-tag@v1 | |
id: "tag_create" | |
with: | |
tag: ${{ steps.version.outputs.version }} | |
tag_exists_error: false | |
- name: Step 8 - Create GitHub release | |
id: create_release | |
uses: elgohr/Github-Release-Action@v5 | |
with: | |
title: openhtmltopdf | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |