-
Notifications
You must be signed in to change notification settings - Fork 55
153 lines (149 loc) · 6.37 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
143
144
145
146
147
148
149
150
151
152
153
name: Release on manual push
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release version'
required: true
jobs:
release:
name: "Release"
runs-on: ubuntu-latest
env:
IMAGE_TAG: ${{ inputs.release_version }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
tool-cache: false
docker-images: false
- uses: actions/checkout@v3
- name: Set version
run: |
sed -i "s/1.0.0-SNAPSHOT/${{ inputs.release_version }}/g" build.gradle.kts
- run: |
git tag v${{ inputs.release_version }}
git push --tags
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle wrapper validation
uses: gradle/wrapper-validation-action@v3
- name: Running gradle build
uses: eskatos/gradle-command-action@v3
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
with:
arguments: build publish --no-daemon
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images (issuer)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-services/waltid-issuer-api/Dockerfile
tags: waltid/issuer-api:latest, waltid/issuer-api:${{ inputs.release_version }}
- name: Build and push Docker images (verifier)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-services/waltid-verifier-api/Dockerfile
tags: waltid/verifier-api:latest, waltid/verifier-api:${{ inputs.release_version }}
- name: Build and push Docker images (wallet-api)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-services/waltid-wallet-api/Dockerfile
tags: waltid/wallet-api:latest, waltid/wallet-api:${{ inputs.release_version }}
- name: Build and push Docker images (waltid-demo-wallet)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-applications/waltid-web-wallet/apps/waltid-demo-wallet/Dockerfile
tags: waltid/waltid-demo-wallet:latest, waltid/waltid-demo-wallet:${{ inputs.release_version }}
- name: Build and push Docker images (waltid-dev-wallet)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-applications/waltid-web-wallet/apps/waltid-dev-wallet/Dockerfile
tags: waltid/waltid-dev-wallet:latest, waltid/waltid-dev-wallet:${{ inputs.release_version }}
- name: Build and push Docker images (wallet-portal)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-applications/waltid-web-portal/Dockerfile
tags: waltid/portal:latest, waltid/portal:${{ inputs.release_version }}
- name: Changelog
uses: ardalanamini/auto-changelog@v4
id: changelog
with:
github-token: ${{ github.token }}
default-commit-type: Other Changes
release-name: v${{ inputs.release_version }}
mention-authors: true
mention-new-contributors: true
include-compare-link: true
use-github-autolink: true
semver: true
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ inputs.release_version }}
body: |
${{ steps.changelog.outputs.changelog }}
prerelease: ${{ steps.changelog.outputs.prerelease }}
# issuer-api
- name: Prepare CD - issuer
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-services/waltid-issuer-api/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-services/waltid-issuer-api/k8s/deployment_mod.yaml
- name: Continuous deployment - issuer
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n portals -f waltid-services/waltid-issuer-api/k8s/deployment_mod.yaml
# verifier-api
- name: Prepare CD - verifier
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-services/waltid-verifier-api/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-services/waltid-verifier-api/k8s/deployment_mod.yaml
- name: Continuous deployment - verifier
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n portals -f waltid-services/waltid-verifier-api/k8s/deployment_mod.yaml
# wallet-api
- name: Prepare CD - wallet.walt.id
env:
PROD_KEYCLOAK_CLIENT_SECRET: ${{ secrets.PROD_KEYCLOAK_CLIENT_SECRET }}
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-services/waltid-wallet-api/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_KEYCLOAK_CLIENT_SECRET__/$PROD_KEYCLOAK_CLIENT_SECRET/g" |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-services/waltid-wallet-api/k8s/deployment_mod.yaml
- name: Continuous deployment - web wallet
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n default -f waltid-services/waltid-wallet-api/k8s/deployment_mod.yaml
# portal
- name: Prepare CD - portal.walt.id
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-applications/waltid-web-portal/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-applications/waltid-web-portal/k8s/deployment_mod.yaml
- name: Continuous deployment - portal.walt.id
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n portals -f waltid-applications/waltid-web-portal/k8s/deployment_mod.yaml