-
Notifications
You must be signed in to change notification settings - Fork 18
46 lines (37 loc) · 1.61 KB
/
staging.yml
File metadata and controls
46 lines (37 loc) · 1.61 KB
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
name: staging
on:
# To trigger this workflow manually, you can use the following curl command:
# curl -XPOST -u "USERNAME:PERSONAL_TOKEN" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/JavaVisRec/visrec-api/dispatches --data '{"event_type": "staging-pub"}'
# Make sure you create your personal token with repo access. Follow steps in
# https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
# to create your personal token.
# Special thanks to AWS Labs & AWS DJL project for this approach
repository_dispatch:
types: [staging-pub]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
#settings-path: ${{ github.workspace }} # location for the settings.xml
#server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
- name: Build with Maven
run: ./mvnw package
- name: Add private key to keyring
run: |
echo "${PRIVATE_KEY}" > private.key
gpg --import --batch private.key
env:
PRIVATE_KEY: ${{ secrets.GPG_SECRET_KEY }}
- name: Publish to repository
run: |
sed -i "s/-SNAPSHOT//g" pom.xml
./mvnw deploy -s settings.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}