-
Notifications
You must be signed in to change notification settings - Fork 12
142 lines (136 loc) · 4.2 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# This workflow:
# - Packages up the encoders, and publishes to Maven
# - Packages up the Python library, and publishes to PyPI
# - Builds the server Docker image, and pushes to Docker Hub
# - Creates a draft release
#
# This is only run when a version tag is pushed.
name: Release
on:
push:
tags:
- "v**"
jobs:
deploy-maven:
name: Maven Central
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# This is required so that git-commit-id-plugin can find the latest tag.
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: "zulu"
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install GPG key
run: |
cat <(echo -e "${{ secrets.GPG_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Configure Maven settings
uses: s4u/maven-settings-action@v2.6.0
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_PASSWORD }}"
}]
- name: Run the deploy goal with Maven
run: |
mvn --batch-mode deploy \
-pl fhir-server,library-api,library-runtime -am \
-PmavenRelease,docs \
-DskipTests \
-Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"
timeout-minutes: 30
deploy-python:
name: PyPI
runs-on: ubuntu-latest
needs: deploy-maven
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# This is required so that git-commit-id-plugin can find the latest tag.
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: "zulu"
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run the deploy goal with Maven
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
mvn --batch-mode deploy \
-pl lib/python -am \
-PpythonRelease \
-DskipTests
timeout-minutes: 30
deploy-docker:
name: Docker Hub
runs-on: ubuntu-latest
needs: deploy-python
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# This is required so that git-commit-id-plugin can find the latest tag.
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: "zulu"
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run the deploy goal with Maven
run: |
mvn --batch-mode deploy \
-pl fhir-server -am \
-Pdocker \
-DskipTests -DskipScalaDocs
timeout-minutes: 30
create-release:
name: Draft GitHub release
runs-on: ubuntu-latest
needs: [ deploy-maven, deploy-python, deploy-docker ]
steps:
- name: Extract tag name
id: extract_tag
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
draft: true
prerelease: false