diff --git a/.github/workflows/sign-artefacts.yml b/.github/workflows/sign-artefacts.yml new file mode 100644 index 0000000..2986152 --- /dev/null +++ b/.github/workflows/sign-artefacts.yml @@ -0,0 +1,45 @@ +name: Test the signing of artefacts + +on: + workflow_dispatch: + +jobs: + compile: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Java environment + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - id: install-secret-key + name: Install gpg secret key + run: | + # Install gpg secret key + cat <(echo -e "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}") | gpg --batch --import + # Verify gpg secret key + gpg --list-secret-keys --keyid-format LONG + - name: Package jSEPA + run: | + mvn \ + --batch-mode \ + -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} \ + -Psign \ + clean package + - name: Upload artefacts + uses: actions/upload-artifact@v4 + if: success() + with: + name: jSEPA-compile + retention-days: 1 + path: "./target/*" \ No newline at end of file