Skip to content

Commit 858d536

Browse files
committed
add github-publish-workflow
1 parent e681243 commit 858d536

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish-github.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to GitHub Packages
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
publish:
7+
runs-on: windows-latest
8+
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-java@v1
12+
with:
13+
java-version: 11
14+
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
15+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
16+
- uses: actions/cache@v2
17+
with:
18+
path: ~/.m2/repository
19+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
20+
restore-keys: |
21+
${{ runner.os }}-maven-
22+
- name: Enforce project version ${{ github.event.release.tag_name }}
23+
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
24+
- name: Deploy
25+
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
29+
- name: Slack Notification
30+
uses: rtCamp/action-slack-notify@v2
31+
env:
32+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
33+
SLACK_USERNAME: 'Cryptobot'
34+
SLACK_ICON:
35+
SLACK_ICON_EMOJI: ':bot:'
36+
SLACK_CHANNEL: 'cryptomator-desktop'
37+
SLACK_TITLE: "Published ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}"
38+
SLACK_MESSAGE: "Ready to <https://github.com/${{ github.repository }}/actions?query=workflow%3A%22Publish+to+Maven+Central%22|deploy to Maven Central>."
39+
SLACK_FOOTER:
40+
MSG_MINIMAL: true

0 commit comments

Comments
 (0)