forked from sovity/edc-ce
-
Notifications
You must be signed in to change notification settings - Fork 1
183 lines (180 loc) · 7.87 KB
/
ci.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: CI
on:
push:
branches: [ main ]
release:
types: [ published ]
pull_request:
branches: [ main ]
env:
REGISTRY_URL: ghcr.io
REGISTRY_USER: ${{ github.actor }}
IMAGE_BASE_NAME: ${{ github.repository_owner }}
GITHUB_CI: true
jobs:
build-gradle-project:
name: Build Gradle Project
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
packages: write
steps:
- uses: FranzDiebold/github-env-vars-action@v2
- uses: actions/checkout@v3
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: "Gradle: Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: "Gradle: Include last commit info and build date for JARs"
run: |
git log -1 > extensions/last-commit-info/src/main/resources/jar-last-commit-info.txt
echo $(date --utc +%FT%TZ) > extensions/last-commit-info/src/main/resources/jar-build-date.txt
- name: "Gradle: Overwrite Artifact Version (Release Only)"
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
GRADLE_ARGS="-PsovityEdcExtensionsVersion=${GITHUB_REF#refs/tags/v}"
echo "GRADLE_ARGS=$GRADLE_ARGS" >> $GITHUB_ENV
- name: "Gradle: Build"
uses: gradle/[email protected]
with:
arguments: build ${{ env.GRADLE_ARGS }}
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Gradle: Publish (Main & Release Only)"
uses: gradle/[email protected]
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
with:
arguments: publish ${{ env.GRADLE_ARGS }}
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Docker Image: edc-dev"
uses: ./.github/actions/build-connector-image
with:
registry-url: ${{ env.REGISTRY_URL }}
registry-user: ${{ env.REGISTRY_USER }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-base-name: ${{ env.IMAGE_BASE_NAME }}
image-name: "edc-dev"
connector-name: "sovity-dev"
deployment-type: "connector"
title: "sovity Dev EDC Connector"
description: "Extended EDC Connector built by sovity. This dev version contains no dataspace auth and can be used to quickly start a locally running EDC + EDC UI."
- name: "Docker Image: edc-ce"
uses: ./.github/actions/build-connector-image
with:
registry-url: ${{ env.REGISTRY_URL }}
registry-user: ${{ env.REGISTRY_USER }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-base-name: ${{ env.IMAGE_BASE_NAME }}
image-name: "edc-ce"
connector-name: "sovity-ce"
deployment-type: "connector"
title: "sovity Community Edition EDC Connector"
description: "EDC Connector built by sovity. Contains sovity's Community Edition EDC extensions and requires dataspace credentials to join an existing dataspace."
- name: "Docker Image: edc-ce-mds"
uses: ./.github/actions/build-connector-image
with:
registry-url: ${{ env.REGISTRY_URL }}
registry-user: ${{ env.REGISTRY_USER }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-base-name: ${{ env.IMAGE_BASE_NAME }}
image-name: "edc-ce-mds"
connector-name: "mds-ce"
deployment-type: "connector"
title: "MDS Community Edition EDC Connector"
description: "EDC Connector built by sovity and configured for compatibility with the Mobility Data Space (MDS). This EDC requires dataspace credentials, and additional MDS Services such as a Clearing House."
- name: "Docker Image: test-backend"
uses: ./.github/actions/build-connector-image
with:
registry-url: ${{ env.REGISTRY_URL }}
registry-user: ${{ env.REGISTRY_USER }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-base-name: ${{ env.IMAGE_BASE_NAME }}
image-name: "test-backend"
connector-name: "test-backend"
deployment-type: "connector"
title: "Test Data Source / Data Sink"
description: "Provides a minimal data source / data sink for E2E tests."
- name: "Docker Image: catalog-crawler-dev"
uses: ./.github/actions/build-connector-image
with:
registry-url: ${{ env.REGISTRY_URL }}
registry-user: ${{ env.REGISTRY_USER }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-base-name: ${{ env.IMAGE_BASE_NAME }}
image-name: "catalog-crawler-dev"
connector-name: "catalog-crawler-dev"
deployment-type: "catalog-crawler"
title: "Catalog Crawler (Dev)"
description: "sovity CE Catalog crawler for the sovity CE Authority Portal. This dev version contains no auth and can be used to quickly start a locally running Catalog Crawler."
- name: "Docker Image: catalog-crawler-ce"
uses: ./.github/actions/build-connector-image
with:
registry-url: ${{ env.REGISTRY_URL }}
registry-user: ${{ env.REGISTRY_USER }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-base-name: ${{ env.IMAGE_BASE_NAME }}
image-name: "catalog-crawler-ce"
connector-name: "catalog-crawler-ce"
deployment-type: "catalog-crawler"
title: "Catalog Crawler (Community Edition, DAPS)"
description: "sovity CE Catalog crawler for the sovity CE Authority Portal. Requires DAPS dataspace credentials to join an existing dataspace."
ts-api-client-library:
name: TS API Client Library
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: FranzDiebold/github-env-vars-action@v2
- uses: actions/checkout@v3
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: "Set up Node 16"
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: extensions/wrapper/clients/typescript-client/package.json
- name: "Gradle: Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: "Gradle: Generate TS Code"
uses: gradle/[email protected]
with:
arguments: :extensions:wrapper:wrapper:build -x test
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "NPM: Dist Tag & Version"
working-directory: ./extensions/wrapper/clients/typescript-client
run: |
if [[ "$GITHUB_REF" == "refs/tags/v"* ]]; then
# Full Release
VERSION="${GITHUB_REF#refs/tags/v}"
DIST_TAG=latest
else
VERSION="0.$(date '+%Y%m%d.%H%M%S')-main-$CI_SHA_SHORT"
DIST_TAG=main
fi
npm version $VERSION
echo "DIST_TAG=$DIST_TAG" >> $GITHUB_ENV
- name: "NPM: Build"
working-directory: extensions/wrapper/clients/typescript-client
run: npm ci && npm run build
- name: "NPM: Publish (Main & Releases Only)"
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
working-directory: extensions/wrapper/clients/typescript-client
run: |
npm set //registry.npmjs.org/:_authToken $NODE_AUTH_TOKEN
npm set //registry.npmjs.org/:username $NODE_USER
npm publish --access public --tag "${{ env.DIST_TAG }}"
env:
NODE_USER: richardtreier-sovity
NODE_AUTH_TOKEN: ${{ secrets.SOVITY_EDC_CLIENT_NPM_AUTH }}