-
Notifications
You must be signed in to change notification settings - Fork 17
193 lines (168 loc) · 6.99 KB
/
main-publish-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
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
184
185
186
187
188
189
190
191
192
193
name: Build and publish the release to GitHub releases and PyPi
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build-release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Build with Maven
run: mvn package -DskipTests -DcompressZip=true -Pbuild-with-jdk-11 -Prun-npm
- uses: juliangruber/read-file-action@v1
name: Read VERSION
id: read_version
with:
path: ./VERSION
- uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.RELEASES_SERVICE_ACCOUNT_JSON }}
- id: 'upload-release-asia'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-asia/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-australia-southeast1'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-australia-southeast1/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-eu'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-eu/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-europe-central2'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-europe-central2/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-in'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-in/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-me-central1'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-me-central1/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-me-west1'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-me-west1/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-southamerica-east1'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-southamerica-east1/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-africa-south1'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-africa-south1/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- id: 'upload-release-us'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip'
destination: '${{ secrets.DQOPS_COM_WWW_BUCKET_PREFIX }}-us/releases'
gzip: false
process_gcloudignore: false
headers: |-
content-type: application/zip
- uses: docker-practice/actions-setup-docker@master
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build and Push Docker Image
with:
image: dqops/dqo
tags: ${{ steps.read_version.outputs.content }},latest
dockerfile: Dockerfile-fast
enableBuildKit: true
multiPlatform: true
platform: linux/amd64,linux/arm64
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create GitHub release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: v${{ steps.read_version.outputs.content }}
tag_name: v${{ steps.read_version.outputs.content }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload distribution binary file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip
asset_name: dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip
asset_content_type: application/zip
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./distribution/python/requirements.txt
- name: Build PyPi package
run: |
python -m build ./distribution/python
- name: Publish PyPi package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: distribution/python/dist/
user: __token__
password: ${{ secrets.PYPI_TOKEN }}