From 23f03423b5b4a21a8d200628da098032a35e3fbc Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Fri, 8 Nov 2024 09:37:07 +0100 Subject: [PATCH 1/2] Add release workflow Signed-off-by: Edoardo Vacchi --- .github/workflows/release.yaml | 78 ++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..4a3b5b3 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,78 @@ +name: release + +on: + workflow_dispatch: + inputs: + release-version: + description: 'Version being released' + required: true + branch: + description: 'Branch to release from' + required: true + default: 'main' + +permissions: + contents: write + +jobs: + release: + name: Release + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - id: install-secret-key + name: Install gpg secret key + run: | + cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + + - name: Compile + run: mvn --batch-mode verify + + - name: Setup Git + run: | + git config user.name "Extism BOT" + git config user.email "extism@dylibso.com" + + - name: Set the version + run: | + mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }} + ./scripts/update-docs-version ${{ github.event.inputs.release-version }} + git add . + git commit -m "Release version update ${{ github.event.inputs.release-version }}" + git push + git tag ${{ github.event.inputs.release-version }} + git push origin ${{ github.event.inputs.release-version }} + env: + GITHUB_TOKEN: ${{secrets.GH_TOKEN}} + + - name: Release to Maven Central + run: | + mvn --batch-mode clean verify deploy -Drelease -DskipTests=true -X + env: + MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + + - name: Back to Snapshot + run: | + mvn versions:set -DgenerateBackupPoms=false -DnewVersion=999-SNAPSHOT + git add . + git commit -m "Snapshot version update" + git push + env: + GITHUB_TOKEN: ${{secrets.GH_TOKEN}} From 209a493588afcdc4d45337502997e5a57be9fb81 Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Fri, 15 Nov 2024 10:49:04 +0100 Subject: [PATCH 2/2] Add release workflow Signed-off-by: Edoardo Vacchi --- .github/workflows/release.yaml | 42 +++++++++++---------- pom.xml | 67 ++++++++++++---------------------- 2 files changed, 45 insertions(+), 64 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4a3b5b3..04aa466 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,6 +23,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Install libextism + uses: ./.github/actions/libextism + - name: Setup Java uses: actions/setup-java@v4 with: @@ -30,49 +33,48 @@ jobs: distribution: 'temurin' server-id: ossrh server-username: MAVEN_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - id: install-secret-key name: Install gpg secret key run: | - cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import + cat <(echo -e "${{ secrets.JRELEASER_GPG_SECRET_KEY }}") | gpg --batch --import gpg --list-secret-keys --keyid-format LONG - name: Compile - run: mvn --batch-mode verify + run: mvn --batch-mode --no-transfer-progress verify - name: Setup Git run: | git config user.name "Extism BOT" - git config user.email "extism@dylibso.com" + git config user.email "oss@extism.org" - name: Set the version run: | - mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }} - ./scripts/update-docs-version ${{ github.event.inputs.release-version }} - git add . - git commit -m "Release version update ${{ github.event.inputs.release-version }}" - git push - git tag ${{ github.event.inputs.release-version }} - git push origin ${{ github.event.inputs.release-version }} + mvn --batch-mode --no-transfer-progress versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }} env: - GITHUB_TOKEN: ${{secrets.GH_TOKEN}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Release to Maven Central run: | - mvn --batch-mode clean verify deploy -Drelease -DskipTests=true -X + mvn --batch-mode --no-transfer-progress -Prelease clean verify deploy -X env: - MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + MAVEN_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} - - name: Back to Snapshot + - name: Commit tag, back to Snapshot and Push + if: ${{ ! endsWith(github.event.inputs.release-version, '-SNAPSHOT') }} run: | - mvn versions:set -DgenerateBackupPoms=false -DnewVersion=999-SNAPSHOT + git add . + git commit -m "Release version update ${{ github.event.inputs.release-version }}" + git tag ${{ github.event.inputs.release-version }} + mvn --batch-mode --no-transfer-progress versions:set -DgenerateBackupPoms=false -DnewVersion=999-SNAPSHOT git add . git commit -m "Snapshot version update" git push + git push origin ${{ github.event.inputs.release-version }} env: - GITHUB_TOKEN: ${{secrets.GH_TOKEN}} + GITHUB_TOKEN: ${{ github.token }} diff --git a/pom.xml b/pom.xml index 9d052af..3a40bb5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.extism.sdk extism jar - 1.1.0 + 999-SNAPSHOT extism https://github.com/extism/extism Java-SDK for Extism to use webassembly from Java @@ -43,9 +43,17 @@ Github - https://github.com/extism/extism/issues + https://github.com/extism/java-sdk/issues + + + ossrh + Central Repository OSSRH + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + 11 UTF-8 @@ -62,13 +70,18 @@ 3.10.1 2.22.2 - - true release + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + @@ -115,36 +128,13 @@ - org.jreleaser - jreleaser-maven-plugin - 1.3.1 + org.sonatype.plugins + nexus-staging-maven-plugin + true - - - - true - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local - - target/staging-deploy - - - - - + ossrh + https://s01.oss.sonatype.org/ + true @@ -152,17 +142,6 @@ - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - -