-
Notifications
You must be signed in to change notification settings - Fork 4
116 lines (109 loc) · 3.68 KB
/
sdk.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
name: Release SDK
on:
push:
paths-ignore:
- 'writer/**'
- '.github/workflows/main.yml'
- '.github/workflows/reuse.yml'
- '*.md'
- 'openapi3.yml'
pull_request:
paths-ignore:
- 'writer/**'
- '.github/workflows/main.yml'
- '.github/workflows/reuse.yml'
- '*.md'
- 'openapi3.yml'
env:
JAVA_VERSION: '17'
jobs:
# Test
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
- name: Test code
uses: noi-techpark/github-actions/maven-test@v2
with:
java-version: ${{ env.JAVA_VERSION }}
test-command: 'mvn -B test'
# Release Test Snapshot SDK
release-sdk-snapshot:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/main'
needs: test
concurrency: release-sdk-snapshot
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: '0' # to get all branches and tags
- name: Install xmlstarlet
run: sudo apt-get install -y xmlstarlet
- name: Preparation for a snapshot release with latest production version
run: |
git fetch origin prod
LAST_VERSION=$(git describe --abbrev=0 FETCH_HEAD)
echo "Releasing ${LAST_VERSION}-SNAPSHOT"
./infrastructure/utils/quickrelease.sh snapshot "$LAST_VERSION"
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: 'maven'
- name: Create a settings.xml file
env:
SETTINGS_XML: |
<settings>
<servers>
<server>
<id>maven-repo.opendatahub.com-snapshot</id>
<username>${{ secrets.AWS_S3_ACCESS_KEY_ID }}</username>
<password>${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}</password>
</server>
</servers>
</settings>
run: echo "$SETTINGS_XML" > ~/.m2/settings.xml
- name: Deploy the SDK to our maven repo
run: mvn -B -DskipTests --projects dto --projects client --also-make install deploy
# Release Production SDK
release-sdk-prod:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: test
concurrency: release-sdk-prod
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install xmlstarlet
run: sudo apt-get install -y xmlstarlet
- name: Prepare for a production release with given version tag
run: |
THIS_VERSION=${GITHUB_REF/refs\/tags\/v/}
echo "Releasing ${THIS_VERSION}"
./infrastructure/utils/quickrelease.sh release "$THIS_VERSION"
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: 'maven'
- name: Create a settings.xml file
env:
SETTINGS_XML: |
<settings>
<servers>
<server>
<id>maven-repo.opendatahub.com-release</id>
<username>${{ secrets.AWS_S3_ACCESS_KEY_ID }}</username>
<password>${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}</password>
</server>
</servers>
</settings>
run: echo "$SETTINGS_XML" > ~/.m2/settings.xml
- name: Deploy the SDK to our maven repo
run: mvn -B -DskipTests --projects dto --projects client --also-make install deploy