From 3043d1b124ea7c1b3187cbe06e7912b191b40a7e Mon Sep 17 00:00:00 2001 From: KastenKlicker <63316173+KastenKlicker@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:45:43 +0200 Subject: [PATCH] Create release.yml --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4a657f0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: deploy-to-maven-central +on: + workflow_dispatch +jobs: + release: + name: Release + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Java 21 + uses: actions/setup-java@v4 # Does also set up Maven and GPG + with: + distribution: 'temurin' + java-package: 'jdk' + java-version: '21' + check-latest: true + server-id: 'central' # must match the serverId configured for the nexus-staging-maven-plugin + server-username: CENTRAL_USERNAME # Env var that holds your central user name + server-password: CENTRAL_TOKEN # Env var that holds your central user token + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret + gpg-passphrase: SIGN_KEY_PASS # Env var that holds the key's passphrase + cache: 'maven' + - name: Build & Deploy + run: | + # -U force updates just to make sure we are using latest dependencies + # -B Batch mode (do not ask for user input), just in case + # -P activate profile + mvn -U -B clean deploy -P release + env: + SIGN_KEY_PASS: ${{ secrets.GPG_KEY_PASSPHRASE }} + CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} + CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}