-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (52 loc) · 2.01 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
57
58
name: Publish
on: workflow_dispatch
jobs:
main:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Release Name
shell: python
run: |
import os
#ref = os.environ['GITHUB_REF']
#name = ref[ref.rfind('/') + 1:]
with open('VERSION', 'r') as verFile:
name = verFile.read().strip()
with open(os.environ['GITHUB_ENV'], 'w') as env:
print('RELEASE_NAME=' + name, file=env)
- name: Bundle Code
working-directory: ${{github.workspace}}/jnigen
shell: bash
run: ./gradlew -PbuildDir=build bundleCpp bundleJava
- name: Publish to OSSRH
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_KEY_PASSWD: ${{ secrets.GPG_KEY_PASSWD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
working-directory: ${{github.workspace}}/jnigen
shell: bash
run: |
echo $GPG_KEY | base64 --decode | gpg --import --batch --pinentry-mode=loopback
gpg --batch --pinentry-mode=loopback --keyring secring.gpg --export-secret-keys --passphrase "$GPG_KEY_PASSWD" > $HOME/.gnupg/secring.gpg
./gradlew -PbuildDir=build \
-Psigning.keyId=$GPG_KEY_ID \
-Psigning.password=$GPG_KEY_PASSWD \
-Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg \
-PossrhUsername=$OSSRH_USERNAME \
-PossrhPassword=$OSSRH_PASSWORD \
publishAllPublicationsToOssrhRepository
- name: Make release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
name: ${{ env.RELEASE_NAME }}
body: ...edit me...
files: |
jnigen/build/SimpleJNI-${{ env.RELEASE_NAME }}-cpp-only.zip
jnigen/build/SimpleJNI-${{ env.RELEASE_NAME }}-jnigen.zip