-
Notifications
You must be signed in to change notification settings - Fork 437
218 lines (180 loc) · 7.36 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
name: "Publish all libs, Arrow-stack and Docs"
on:
push:
branches:
- main
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=512m -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: 35
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Restore Gradle cache
id: cache
uses: actions/cache@v2.1.7
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
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: 25
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Restore Gradle cache
id: cache
uses: actions/cache@v2.1.7
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
run: |
./gradlew publishToSonatype
echo "$(cat gradle.properties | grep projects.version | cut -d'=' -f2) MingwX64 deployed!"
- name: Stop Gradle daemons
run: ./gradlew --stop
publish_doc:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_CLOUDFRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID }}
AWS_DEFAULT_REGION: eu-west-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs=-Xmx8g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF-8 -Dorg.gradle.parallel=false"
JAVA_OPTS: -Xms2g -Xmx4g
JEKYLL_ENV: production
S3_BUCKET: ${{ secrets.S3_BUCKET }}
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 config set --local path 'vendor/bundle'
bundle install --gemfile Gemfile
- name: "Create API doc"
run: ./gradlew dokkaGfm
- name: "Landing page: build"
working-directory: arrow-site
if: ${{ github.ref == 'refs/heads/main' }}
run: |
bundle exec jekyll build -b docs -s docs
tree _site > $BASEDIR/logs/content.log
- name: "Landing page: publish"
working-directory: arrow-site
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo ">>> Landing page" >> $BASEDIR/logs/aws_sync.log
${GITHUB_WORKSPACE}/.github/scripts/publish-landing-page.sh
- name: "Latest release: publish (/docs)"
working-directory: arrow-site
if: ${{ github.ref == 'refs/heads/main' }}
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>)"
working-directory: arrow-site
if: ${{ github.ref == 'refs/heads/main' }}
run: |
SHORT_VERSION=$(echo $RELEASE_VERSION | cut -d. -f1-2)
bundle exec jekyll build -b docs/${SHORT_VERSION} -s docs
tree _site > $BASEDIR/logs/content_docs-${SHORT_VERSION}.log
- name: "Latest release: publish release directory (/docs/<major.minor>)"
working-directory: arrow-site
if: ${{ github.ref == 'refs/heads/main' }}
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 --exclude "index.html" >> $BASEDIR/logs/aws_sync.log
else
exit 1
fi
- name: "Next version: build (/docs/next)"
working-directory: arrow-site
if: ${{ github.ref == 'refs/heads/main' }}
run: |
bundle exec jekyll build -b docs/next -s docs
tree _site > $BASEDIR/logs/content_docs-next.log
- name: "Next version: publish (/docs/next)"
working-directory: arrow-site
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo ">>> NEXT VERSION" >> $BASEDIR/logs/aws_sync.log
aws s3 sync _site s3://$S3_BUCKET/docs/next --delete --exclude "index.html" >> $BASEDIR/logs/aws_sync.log
- name: "Site: publish sitemap.xml"
if: ${{ 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@v2
with:
name: logs
path: arrow-libs/logs
- name: Stop Gradle daemons
run: ./gradlew --stop