-
Notifications
You must be signed in to change notification settings - Fork 18
56 lines (49 loc) · 1.47 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Publish Java
on:
push:
tags:
- '*'
- '!**-dev**'
jobs:
release:
runs-on: ubuntu-latest
needs: publish
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set Version
id: set_version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
shell: bash
- name: Create Release
run: |
gh release create ${{ env.VERSION }} --title "Release ${{ env.VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'adopt'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{env.GPG_SECRET_KEY}}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish
run : |
echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | gpg --batch --import
VERSION="${GITHUB_REF#refs/*/}" make publish
env:
GPG_SECRET_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}