From 16c98945e15b8b249ffac683d203f2498c71d8fe Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Thu, 2 Jan 2025 18:03:27 +0100 Subject: [PATCH] WIP --- .github/workflows/deploy.yml | 49 ++++++++++++++++++++++++++++++++++++ pom.xml | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000000..a6a9ad2b1aa --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,49 @@ +name: Publish package to GitHub Packages +on: + push: + tags: + # XXX: Change to 'v*-picnic-*' + - 'v*-test-*' +# XXX: drop. +# release: +# types: [created] +permissions: + contents: read +jobs: + publish: + runs-on: ubuntu-24.04 + permissions: + contents: read + packages: write + steps: + - name: Install Harden-Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + with: + disable-sudo: true + egress-policy: audit + # XXX: We're using `actions/setup-java` here because + # `s4u/setup-maven-action` does not appear to support the multi-version + # `java-version:` syntax in a way that also causes both versions to be + # registered in `~/.m2/toolchains.xml`. + - name: Set up JDKs + uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 + with: + java-version: | + 25-ea + 17 + distribution: temurin + - name: Check out code and set up Maven + uses: s4u/setup-maven-action@9a27433d289dd99d73851f653607c39d3444e8ba # v1.17.0 + with: + java-version: 17 + java-distribution: temurin + maven-version: 3.9.9 + - name: Update version + run: mvn versions:set -DnewVersion=${{ github.ref_name }} + - name: Publish package + # XXX: Drop `-DskipTests`! + run: mvn -B deploy -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/PicnicSupermarket/error-prone + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Remove installed project artifacts + run: mvn dependency:purge-local-repository -DmanualInclude='${project.groupId}' -DresolutionFuzziness=groupId diff --git a/pom.xml b/pom.xml index ab4c991ff5d..e0b78da2031 100644 --- a/pom.xml +++ b/pom.xml @@ -303,7 +303,7 @@ 17 - 25 + 25-ea