-
Notifications
You must be signed in to change notification settings - Fork 437
271 lines (222 loc) · 8.95 KB
/
publish.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: "Publish all libs, Arrow-stack and Docs"
on:
push:
branches:
- main
- release/**
paths:
- 'arrow-libs/**'
- '.github/**'
env:
BASEDIR: ${{github.workspace}}/arrow-libs
JAVA_OPTS: -Xms512m -Xmx1024m
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }}
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
OSS_USER: '${{ secrets.OSS_USER }}'
OSS_TOKEN: '${{ secrets.OSS_TOKEN }}'
OSS_STAGING_PROFILE_ID: '${{ secrets.OSS_STAGING_PROFILE_ID }}'
SIGNING_KEY_NAME: '${{ secrets.SIGNING_KEY_NAME }}'
SIGNING_KEY_ID: '${{ secrets.SIGNING_KEY_ID }}'
SIGNING_KEY_PASSPHRASE: '${{ secrets.SIGNING_KEY_PASSPHRASE }}'
SIGNING_KEY: '${{ secrets.SIGNING_KEY }}'
GRADLE_PUBLISH_KEY: '${{ secrets.GRADLE_PUBLISH_KEY }}'
GRADLE_PUBLISH_SECRET: '${{ secrets.GRADLE_PUBLISH_SECRET }}'
jobs:
publish_apple_linux_jvm_js:
runs-on: macos-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Restore Gradle cache
id: cache
uses: actions/cache@v2.1.6
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
key: mac-step-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
mac-step-gradle-
- name: "Install grep"
run: brew install grep
- name: "Set env"
run: ${GITHUB_WORKSPACE}/.github/scripts/set-env.sh
- name: "Show env"
run: ${GITHUB_WORKSPACE}/.github/scripts/show-env.sh
- name: Publish Apple, Linux, JVM & JS targets
working-directory: arrow-libs
run: |
./gradlew publishToSonatype
echo "$(cat $BASEDIR/gradle.properties | grep projects.version | cut -d'=' -f2) Apple, Linux, JVM & JS deployed!"
- name: Stop Gradle daemons
run: ./gradlew --stop
publish_windows:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Restore Gradle cache
id: cache
uses: actions/cache@v2.1.6
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: "Set env"
run: ${GITHUB_WORKSPACE}/.github/scripts/set-env.sh
shell: bash
- name: "Show env"
run: ${GITHUB_WORKSPACE}/.github/scripts/show-env.sh
shell: bash
- name: Publish Windows
working-directory: arrow-libs
run: |
./gradlew publishToSonatype
echo "$(cat gradle.properties | grep projects.version | cut -d'=' -f2) MingwX64 deployed!"
- name: Stop Gradle daemons
run: ./gradlew --stop
publish-arrow-stack:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: arrow-stack
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install grep
run: sudo apt-get install grep
- name: "Set env"
run: ${GITHUB_WORKSPACE}/.github/scripts/set-env.sh
- name: "Show env"
run: ${GITHUB_WORKSPACE}/.github/scripts/show-env.sh
- name: "Publish"
run: |
./gradlew publishToSonatype
echo "$(cat $BASEDIR/gradle.properties | grep projects.version | cut -d'=' -f2) Arrow Stack deployed!"
- name: Stop Gradle daemons
run: ./gradlew --stop
publish_doc:
env:
JAVA_OPTS: -Xms2g -Xmx4g
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Dorg.gradle.parallel=false"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
AWS_CLOUDFRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID }}
AWS_DEFAULT_REGION: eu-west-1
JEKYLL_ENV: production
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Setup"
run: brew install grep
- name: "Set env"
run: ${GITHUB_WORKSPACE}/.github/scripts/set-env.sh
- name: "Show env"
run: ${GITHUB_WORKSPACE}/.github/scripts/show-env.sh
- name: "Prepare environment"
working-directory: arrow-site
run: |
mkdir $BASEDIR/logs
brew install tree
bundle install --gemfile Gemfile --path vendor/bundle
- name: "Assemble"
working-directory: arrow-libs
run: |
echo "Additional step to avoid a random failure with Dokka 0.10.0 and MPP"
./gradlew assemble
- name: "Create API doc"
working-directory: arrow-libs
run: ./gradlew --no-parallel dokkaGfm
- name: "Validate documentation"
working-directory: arrow-site
run: ./gradlew runAnk
- name: "Landing page: build"
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
bundle exec jekyll build -b docs -s build/site
tree _site > $BASEDIR/logs/content.log
- name: "Landing page: publish"
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
echo ">>> Landing page" >> $BASEDIR/logs/aws_sync.log
${GITHUB_WORKSPACE}/.github/scripts/publish-landing-page.sh
- name: "Remove index for versions"
working-directory: arrow-site
run: rm -f build/site/index.md
- name: "Latest release: build (docs/)"
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
bundle exec jekyll build -b docs -s build/site
tree _site > $BASEDIR/logs/content_docs.log
- name: "Latest release: publish (docs/)"
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log
${GITHUB_WORKSPACE}/.github/scripts/publish-latest-release.sh
- name: "Latest release: build release directory (docs/<major.minor>)"
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
working-directory: arrow-site
run: |
SHORT_VERSION=$(echo $RELEASE_VERSION | cut -d. -f1-2)
bundle exec jekyll build -b docs/${SHORT_VERSION} -s build/site
tree _site > $BASEDIR/logs/content_docs-${SHORT_VERSION}.log
- name: "Latest release: publish release directory (docs/<major.minor>)"
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
working-directory: arrow-site
run: |
SHORT_VERSION=$(echo $RELEASE_VERSION | cut -d. -f1-2)
echo ">>> $SHORT_VERSION VERSION" >> $BASEDIR/logs/aws_sync.log
if [ "${SHORT_VERSION}" != "" ]; then
aws s3 sync _site s3://$S3_BUCKET/docs/$SHORT_VERSION --delete >> $BASEDIR/logs/aws_sync.log
else
exit 1
fi
- name: "Next version: build (/docs/next)"
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
bundle exec jekyll build -b docs/next -s build/site
tree _site > $BASEDIR/logs/content_docs-next.log
- name: "Next version: publish (/docs/next)"
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
echo ">>> NEXT VERSION" >> $BASEDIR/logs/aws_sync.log
aws s3 sync _site s3://$S3_BUCKET/docs/next --delete >> $BASEDIR/logs/aws_sync.log
- name: "Site: publish sitemap.xml"
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
run: |
${GITHUB_WORKSPACE}/.github/scripts/create-sitemap.sh > sitemap.xml
aws s3 cp sitemap.xml s3://$S3_BUCKET/sitemap.xml >> $BASEDIR/logs/aws_sync.log
- name: CloudFront cache invalidation
run: aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_ID --paths "/*"
- name: List S3
run: aws s3 ls s3://$S3_BUCKET --recursive --summarize > $BASEDIR/logs/site-content.log
- uses: actions/upload-artifact@v1
with:
name: logs
path: arrow-libs/logs
- name: Stop Gradle daemons
run: ./gradlew --stop