Skip to content

Commit 9bf5d4e

Browse files
committed
Add GitHub workflow to publish as GitHub package
1 parent 700f450 commit 9bf5d4e

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to GitHub Packages
2+
on:
3+
release:
4+
types: [published]
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
jobs:
11+
publish:
12+
runs-on: windows-latest
13+
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-java@v3
17+
with:
18+
distribution: 'temurin'
19+
java-version: 19
20+
cache: 'maven'
21+
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
22+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
23+
- name: Enforce project version ${{ github.event.release.tag_name }}
24+
run: mvn versions:set -B -DnewVersion="${{ github.event.release.tag_name }}"
25+
- name: Deploy
26+
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}

pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,5 +243,15 @@
243243
</plugins>
244244
</build>
245245
</profile>
246+
<profile>
247+
<id>deploy-github</id>
248+
<distributionManagement>
249+
<repository>
250+
<id>github</id>
251+
<name>GitHub Packages</name>
252+
<url>https://maven.pkg.github.com/purejava/winsparkle-java</url>
253+
</repository>
254+
</distributionManagement>
255+
</profile>
246256
</profiles>
247257
</project>

0 commit comments

Comments
 (0)