Test signature of artifacts in CI #106
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: Build | |
on: | |
push: | |
branches: | |
- main | |
- 2.2.x | |
paths-ignore: | |
- README.adoc | |
- docs/** | |
pull_request: | |
branches: | |
- main | |
- 2.2.x | |
paths-ignore: | |
- README.adoc | |
- docs/** | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
max-parallel: 12 | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
java: | |
- 11 | |
- 17 | |
- 21 | |
# Support 1-year-old version + latest minor | |
maven: | |
- 3.8.8 | |
- 3.9.6 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: s4u/[email protected] | |
with: | |
java-distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
maven-version: ${{ matrix.maven }} | |
- name: Maven version | |
run: mvn -version | |
- name: Build & Test | |
run: mvn -B -Prun-its clean verify | |
javadocs: | |
name: Javadocs | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
java: | |
- 11 | |
maven: | |
- 3.9.6 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: s4u/[email protected] | |
with: | |
java-distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
maven-version: ${{ matrix.maven }} | |
- name: Build & Test | |
run: mvn -B clean javadoc:jar | |
signature: | |
name: Sign artifacts | |
environment: test | |
env: | |
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
ARTIFACTS_DIR: target/artifacts | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
java: | |
- 11 | |
maven: | |
- 3.9.6 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Prepare signature | |
run: echo -e "$GPG_PRIVATE_KEY" | gpg --import --batch | |
- uses: s4u/[email protected] | |
with: | |
java-distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
maven-version: ${{ matrix.maven }} | |
- name: Build & Test | |
run: mvn -B clean install -Prelease -DskipTests | |
- name: Collect artifacts | |
run: | | |
mkdir -p $ARTIFACTS_DIR | |
cp -r $HOME/.m2/repository/org/asciidoctor/asciidoctor-maven-* $ARTIFACTS_DIR | |
cp -r $HOME/.m2/repository/org/asciidoctor/*-doxia-module $ARTIFACTS_DIR | |
- name: Print jar signatures | |
run: find $ARTIFACTS_DIR -type f -name "*.jar" -exec gpg {} \; | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: ${{ env.ARTIFACTS_DIR }} |