Skip to content

Commit 209a493

Browse files
committed
Add release workflow
Signed-off-by: Edoardo Vacchi <[email protected]>
1 parent 23f0342 commit 209a493

File tree

2 files changed

+45
-64
lines changed

2 files changed

+45
-64
lines changed

Diff for: .github/workflows/release.yaml

+22-20
Original file line numberDiff line numberDiff line change
@@ -23,56 +23,58 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525

26+
- name: Install libextism
27+
uses: ./.github/actions/libextism
28+
2629
- name: Setup Java
2730
uses: actions/setup-java@v4
2831
with:
2932
java-version: 21
3033
distribution: 'temurin'
3134
server-id: ossrh
3235
server-username: MAVEN_USERNAME
33-
server-password: MAVEN_CENTRAL_TOKEN
34-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
36+
server-password: MAVEN_PASSWORD
37+
gpg-private-key: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
3538
gpg-passphrase: MAVEN_GPG_PASSPHRASE
3639

3740
- id: install-secret-key
3841
name: Install gpg secret key
3942
run: |
40-
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
43+
cat <(echo -e "${{ secrets.JRELEASER_GPG_SECRET_KEY }}") | gpg --batch --import
4144
gpg --list-secret-keys --keyid-format LONG
4245
4346
- name: Compile
44-
run: mvn --batch-mode verify
47+
run: mvn --batch-mode --no-transfer-progress verify
4548

4649
- name: Setup Git
4750
run: |
4851
git config user.name "Extism BOT"
49-
git config user.email "[email protected]"
52+
git config user.email "[email protected]"
5053
5154
- name: Set the version
5255
run: |
53-
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }}
54-
./scripts/update-docs-version ${{ github.event.inputs.release-version }}
55-
git add .
56-
git commit -m "Release version update ${{ github.event.inputs.release-version }}"
57-
git push
58-
git tag ${{ github.event.inputs.release-version }}
59-
git push origin ${{ github.event.inputs.release-version }}
56+
mvn --batch-mode --no-transfer-progress versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }}
6057
env:
61-
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
58+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
6259

6360
- name: Release to Maven Central
6461
run: |
65-
mvn --batch-mode clean verify deploy -Drelease -DskipTests=true -X
62+
mvn --batch-mode --no-transfer-progress -Prelease clean verify deploy -X
6663
env:
67-
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
68-
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
69-
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
64+
MAVEN_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
65+
MAVEN_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
66+
MAVEN_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
7067

71-
- name: Back to Snapshot
68+
- name: Commit tag, back to Snapshot and Push
69+
if: ${{ ! endsWith(github.event.inputs.release-version, '-SNAPSHOT') }}
7270
run: |
73-
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=999-SNAPSHOT
71+
git add .
72+
git commit -m "Release version update ${{ github.event.inputs.release-version }}"
73+
git tag ${{ github.event.inputs.release-version }}
74+
mvn --batch-mode --no-transfer-progress versions:set -DgenerateBackupPoms=false -DnewVersion=999-SNAPSHOT
7475
git add .
7576
git commit -m "Snapshot version update"
7677
git push
78+
git push origin ${{ github.event.inputs.release-version }}
7779
env:
78-
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
80+
GITHUB_TOKEN: ${{ github.token }}

Diff for: pom.xml

+23-44
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>org.extism.sdk</groupId>
66
<artifactId>extism</artifactId>
77
<packaging>jar</packaging>
8-
<version>1.1.0</version>
8+
<version>999-SNAPSHOT</version>
99
<name>extism</name>
1010
<url>https://github.com/extism/extism</url>
1111
<description>Java-SDK for Extism to use webassembly from Java</description>
@@ -43,9 +43,17 @@
4343

4444
<issueManagement>
4545
<system>Github</system>
46-
<url>https://github.com/extism/extism/issues</url>
46+
<url>https://github.com/extism/java-sdk/issues</url>
4747
</issueManagement>
4848

49+
<distributionManagement>
50+
<repository>
51+
<id>ossrh</id>
52+
<name>Central Repository OSSRH</name>
53+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
54+
</repository>
55+
</distributionManagement>
56+
4957
<properties>
5058
<java.version>11</java.version>
5159
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -62,13 +70,18 @@
6270
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
6371
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
6472

65-
<!-- jreleaser -->
66-
<jreleaser.git.root.search>true</jreleaser.git.root.search>
6773
</properties>
6874

6975
<profiles>
7076
<profile>
7177
<id>release</id>
78+
<distributionManagement>
79+
<snapshotRepository>
80+
<id>ossrh</id>
81+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
82+
</snapshotRepository>
83+
</distributionManagement>
84+
7285
<build>
7386
<plugins>
7487
<plugin>
@@ -115,54 +128,20 @@
115128
</executions>
116129
</plugin>
117130
<plugin>
118-
<groupId>org.jreleaser</groupId>
119-
<artifactId>jreleaser-maven-plugin</artifactId>
120-
<version>1.3.1</version>
131+
<groupId>org.sonatype.plugins</groupId>
132+
<artifactId>nexus-staging-maven-plugin</artifactId>
133+
<extensions>true</extensions>
121134
<configuration>
122-
<jreleaser>
123-
<release>
124-
<github>
125-
<skipRelease>true</skipRelease>
126-
</github>
127-
</release>
128-
<signing>
129-
<active>ALWAYS</active>
130-
<armored>true</armored>
131-
</signing>
132-
<deploy>
133-
<maven>
134-
<nexus2>
135-
<maven-central>
136-
<active>ALWAYS</active>
137-
<url>https://s01.oss.sonatype.org/service/local</url>
138-
<!--
139-
<closeRepository>false</closeRepository>
140-
<releaseRepository>false</releaseRepository>
141-
-->
142-
<stagingRepositories>target/staging-deploy</stagingRepositories>
143-
</maven-central>
144-
</nexus2>
145-
</maven>
146-
</deploy>
147-
</jreleaser>
135+
<serverId>ossrh</serverId>
136+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
137+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
148138
</configuration>
149139
</plugin>
150140
</plugins>
151141
</build>
152142
</profile>
153143
</profiles>
154144

155-
<distributionManagement>
156-
<snapshotRepository>
157-
<id>ossrh</id>
158-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
159-
</snapshotRepository>
160-
<repository>
161-
<id>ossrh</id>
162-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
163-
</repository>
164-
</distributionManagement>
165-
166145
<build>
167146
<plugins>
168147
<plugin>

0 commit comments

Comments
 (0)