-
Notifications
You must be signed in to change notification settings - Fork 4
90 lines (90 loc) · 3.01 KB
/
release.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
on:
push:
tags:
- "v*"
workflow_dispatch:
name: Deploy Tagged Release
env:
MAVEN_VERSION: 3.9.8
JAVA_DISTRO: 'temurin'
JAVA_VERSION_FILE: .java-version
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
deploy-to-nexus:
name: Maven Central Deployment
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
submodules: recursive
# -------------------------
# Java
# -------------------------
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1
with:
maven-version: ${{ env.MAVEN_VERSION }}
- name: Set up JDK
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88
with:
java-version-file: ${{ env.JAVA_VERSION_FILE }}
distribution: ${{ env.JAVA_DISTRO }}
cache: 'maven'
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
# -------------------------
# Maven Deploy
# -------------------------
- name: Deploy Maven Artifacts
run: |
mvn -B -e -Prelease -Pgpg -Prelease deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
deploy-website:
name: Website Deployment
runs-on: ubuntu-20.04
permissions:
actions: read
contents: write
steps:
- name: Manage GH_TOKEN
if: env.GH_TOKEN == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
token: ${{ env.GH_TOKEN }}
submodules: recursive
# -------------------------
# Java
# -------------------------
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1
with:
maven-version: ${{ env.MAVEN_VERSION }}
- name: Set up JDK
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88
with:
java-version-file: ${{ env.JAVA_VERSION_FILE }}
distribution: ${{ env.JAVA_DISTRO }}
cache: 'maven'
# -------------------------
# Maven Site
# -------------------------
- name: Build Website
run: |
mvn -B -e -Prelease package site site:stage
- name: Run deploy script
run: |
touch target/staging/.nojekyll
echo "oscal-cli.metaschema.dev" > target/staging/CNAME
bash .github/workflows/deploy.sh --push-only -v -m "Deploying website [ci skip]"