Skip to content

Test artifacts signature #707

Test artifacts signature

Test artifacts signature #707

Workflow file for this run

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:
ARTIFACTS_DIR: target/artifacts
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
java:
- 11
maven:
- 3.9.6
runs-on: ${{ matrix.os }}
steps:
- name: debug
run: |
echo $GPG_KEYNAME
echo $GPG_PASSPHRASE
echo $GPG_PRIVATE_KEY
- 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 --verify "{}.asc" \;
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: signed-artifacts
path: ${{ env.ARTIFACTS_DIR }}