-
Notifications
You must be signed in to change notification settings - Fork 4
165 lines (146 loc) · 6.39 KB
/
github-publish.yaml
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
name: "Publish Artifacts"
on:
workflow_dispatch:
inputs:
module:
required: true
description: "which module to publish"
increment:
required: false
default: incrementMinor
description: "version increment (default: minor)"
jobs:
publish-and-increment:
permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required for actions/checkout
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: true
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
token: ${{ secrets.TOOLS_GHA_TOKEN }}
- name: "Set up JDK 11"
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
# Install an older version of helm until https://github.com/helm/helm/issues/12463 is fixed
- name: "Set up helm"
uses: azure/setup-helm@v3
with:
version: 'v3.11.3'
id: install
- name: "Login to AWS & ECR"
id: login-ecr-public
uses: ./.github/actions/aws-and-ecr-login
with:
role-session-name: github-publish-artifacts
aws-region: us-east-1
public: "true"
- name: "Gradle: Build & Test, Release, Publish"
uses: ./.github/actions/for-module-in-group
with:
module: ${{ inputs.module }}
action: gradle-build-and-publish
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
# We need this to emulate other architectures for multi-platform docker builds
- name: "Set up QEMU for Docker"
uses: docker/setup-qemu-action@v2
# We use the build extensions to do multi-architecture docker builds
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v2
- name: "Publish Operator Images"
uses: gradle/[email protected]
if: ${{ inputs.module == 'operator' }}
with:
arguments: operator:pushCRD operator:pushDockerMultiArch operator:pushHelm -PdockerRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6 -PhelmRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6
env:
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.public-registry }}
- name: "Publish Example Images"
uses: gradle/[email protected]
if: ${{ inputs.module == 'kafka-client' }}
with:
arguments: kafka-client-examples:simple-example:pushDockerMultiArch -PdockerRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6 -PhelmRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6
env:
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.public-registry }}
- name: "Checkout sindri"
uses: actions/checkout@v3
with:
repository: responsivedev/sindri
path: sindri
ref: refs/heads/main
token: ${{ secrets.TOOLS_GHA_TOKEN }}
- name: "Install Kind"
uses: helm/[email protected]
with:
install_only: true
- name: 'Login to AWS & ECR'
uses: ./.github/actions/aws-and-ecr-login
with:
role-session-name: github-publish-artifacts
aws-region: us-west-2
- name: "Set Operator Version"
run: |
echo "OPERATOR_VERSION=$(./gradlew operator:cV | grep Project.version | sed 's/Project version: //')" >> $GITHUB_ENV
- name: "Set Kafka Client Version"
run: |
echo "KAFKA_CLIENTS_VERSION=$(./gradlew kafka-client:cV | grep Project.version | sed 's/Project version: //')" >> $GITHUB_ENV
- name: "Run Smoke Test (Operator)"
working-directory: sindri
if: ${{ inputs.module == 'operator' }}
run: |
./scripts/update-versions -s responsiveOperator -e local -i public.ecr.aws/j8q9y0n6/responsiveinc/responsive-operator:$OPERATOR_VERSION
./scripts/run-smoke-test -s release -w system-tests-pub-release
git checkout -- .
./scripts/update-versions -u -s responsiveOperator -e local -i public.ecr.aws/j8q9y0n6/responsiveinc/responsive-operator:$OPERATOR_VERSION
env:
DD_SERVICE: "https://us5.datadoghq.com/"
DD_API_KEY: ${{ secrets.DD_API_KEY }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- name: "Run Smoke Test (Kafka Clients)"
working-directory: sindri
if: ${{ inputs.module == 'kafka-client' }}
run: |
./scripts/update-client-versions -s release -p true -i public.ecr.aws/j8q9y0n6/responsiveinc/simple-example -t $KAFKA_CLIENTS_VERSION
./scripts/run-smoke-test -s release -w system-tests-pub-release
git checkout -- .
./scripts/update-client-versions -u -s release -p true -i public.ecr.aws/j8q9y0n6/responsiveinc/simple-example -t $KAFKA_CLIENTS_VERSION
env:
DD_SERVICE: "https://us5.datadoghq.com/"
DD_API_KEY: ${{ secrets.DD_API_KEY }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- name: "Create Next Version Commit"
run: |
git config --global user.name 'Responsive Tools'
git config --global user.email '[email protected]'
./gradlew :${{ inputs.module }}:markNextVersion \
-Prelease.incrementer=${{ inputs.increment }} \
-Prelease.dryRun | grep "Creating" | git commit --allow-empty -F -
git push
- name: "Push next platform version to Sindri"
working-directory: sindri
run: |
git config --global user.name 'Responsive Tools'
git config --global user.email '[email protected]'
git commit --allow-empty -am "update responsive-pub artifact versions"
git push
- name: "Increment Version"
uses: gradle/[email protected]
with:
arguments: :${{ inputs.module }}:markNextVersion -Prelease.incrementer=${{ inputs.increment }}