-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (46 loc) · 1.62 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
name: Publish
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
test:
uses: ./.github/workflows/test.yml
publish:
needs: test
environment: production
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: oracle
java-version: 17
- name: Configure GPG Key
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
run: |
echo -n "$GPG_KEY" | base64 --decode | gpg --import
- name: Prepare environment
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
mkdir -p ~/.sbt/1.0
touch ~/.sbt/1.0/sonatype.sbt
echo "credentials += Credentials(Path.userHome / \".sbt\" / \"sonatype_credentials\")" > ~/.sbt/1.0/sonatype.sbt
touch ~/.sbt/sonatype_credentials
echo "realm=Sonatype Nexus Repository Manager" > ~/.sbt/sonatype_credentials
echo "host=s01.oss.sonatype.org" >> ~/.sbt/sonatype_credentials
echo "user=$SONATYPE_USERNAME" >> ~/.sbt/sonatype_credentials
echo "password=$SONATYPE_PASSWORD" >> ~/.sbt/sonatype_credentials
mkdir ~/.sbt/1.0/plugins
touch ~/.sbt/1.0/plugins/gpg.sbt
echo "addSbtPlugin(\"com.github.sbt\" % \"sbt-pgp\" % \"2.1.2\")" > ~/.sbt/1.0/plugins/gpg.sbt
- name: Deploy
run: sbt publishSigned
- name: Message
run: echo "Staging repository created at https://s01.oss.sonatype.org/#stagingRepositories"