diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 782498e..ef9df57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,16 +57,18 @@ jobs: - name: Sign artifacts run: mvn --batch-mode clean verify -Pgpg-signing - - name: Verify signatures + - name: Determine project version run: | - gpg --verify micro-env/target/micro-env-0.1.0-SNAPSHOT.jar.asc \ - micro-env/target/micro-env-0.1.0-SNAPSHOT.jar - - gpg --verify micro-env/target/micro-env-0.1.0-SNAPSHOT-sources.jar.asc \ - micro-env/target/micro-env-0.1.0-SNAPSHOT-sources.jar - - gpg --verify micro-env/target/micro-env-0.1.0-SNAPSHOT-javadoc.jar.asc \ - micro-env/target/micro-env-0.1.0-SNAPSHOT-javadoc.jar + VERSION=$(mvn --batch-mode help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "PROJECT_VERSION=$VERSION" >> "$GITHUB_ENV" - gpg --verify micro-env/target/micro-env-0.1.0-SNAPSHOT.pom.asc \ - micro-env/target/micro-env-0.1.0-SNAPSHOT.pom \ No newline at end of file + - name: Verify signatures + run: | + for artifact in \ + "micro-env/target/micro-env-${PROJECT_VERSION}.jar" \ + "micro-env/target/micro-env-${PROJECT_VERSION}-sources.jar" \ + "micro-env/target/micro-env-${PROJECT_VERSION}-javadoc.jar" \ + "micro-env/target/micro-env-${PROJECT_VERSION}.pom" + do + gpg --verify "${artifact}.asc" "$artifact" + done