1
1
name : " Publish all libs, Arrow-stack and Docs"
2
2
3
3
on :
4
- push :
5
- tags :
6
- - ' **'
4
+ workflow_dispatch :
5
+ branches : [main]
6
+ inputs :
7
+ version :
8
+ description : ' Version'
9
+ required : true
10
+ type : string
7
11
8
12
env :
9
13
BASEDIR : ${{github.workspace}}/arrow-libs
10
14
GRADLE_OPTS : -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
11
- SONATYPE_USER : ${{ secrets.SONATYPE_USER }}
12
- SONATYPE_PWD : ${{ secrets.SONATYPE_PWD }}
13
- ORG_GRADLE_PROJECT_signingKey : ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
14
- ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }}
15
15
OSS_USER : ' ${{ secrets.OSS_USER }}'
16
16
OSS_TOKEN : ' ${{ secrets.OSS_TOKEN }}'
17
17
OSS_STAGING_PROFILE_ID : ' ${{ secrets.OSS_STAGING_PROFILE_ID }}'
18
18
SIGNING_KEY_NAME : ' ${{ secrets.SIGNING_KEY_NAME }}'
19
19
SIGNING_KEY_ID : ' ${{ secrets.SIGNING_KEY_ID }}'
20
20
SIGNING_KEY_PASSPHRASE : ' ${{ secrets.SIGNING_KEY_PASSPHRASE }}'
21
21
SIGNING_KEY : ' ${{ secrets.SIGNING_KEY }}'
22
- GRADLE_PUBLISH_KEY : ' ${{ secrets.GRADLE_PUBLISH_KEY }}'
23
- GRADLE_PUBLISH_SECRET : ' ${{ secrets.GRADLE_PUBLISH_SECRET }}'
24
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
25
- AWS_CLOUDFRONT_ID : ${{ secrets.AWS_CLOUDFRONT_ID }}
26
- AWS_DEFAULT_REGION : eu-west-1
27
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28
- JEKYLL_ENV : production
29
- S3_BUCKET : ${{ secrets.S3_BUCKET }}
30
22
31
23
jobs :
32
24
publish :
46
38
- name : assemble
47
39
uses : gradle/gradle-build-action@v2
48
40
with :
49
- arguments : assemble -Pkotlin.mpp.enableCompatibilityMetadataVariant=true
50
-
51
- - name : Get Arrow version
52
- id : version
53
- run : echo "::set-output name=arrow::$(head -n 1 build/semver/version.txt)"
41
+ arguments : assemble -Pversion=${{ inputs.version }} -Pkotlin.mpp.enableCompatibilityMetadataVariant=true
54
42
55
43
- name : Upload reports
56
44
if : failure()
@@ -59,103 +47,7 @@ jobs:
59
47
name : ' reports-${{ matrix.os }}'
60
48
path : ' **/build/reports/**'
61
49
62
- - name : Publish alpha/beta/rc version
63
- uses : gradle/gradle-build-action@v2
64
- if : |
65
- contains(steps.version.outputs.arrow, 'alpha') ||
66
- contains(steps.version.outputs.arrow, 'beta') ||
67
- contains(steps.version.outputs.arrow, 'rc')
68
- with :
69
- arguments : -Pkotlin.mpp.enableCompatibilityMetadataVariant=true publishToSonatype closeAndReleaseSonatypeStagingRepository
70
-
71
50
- name : Publish final version
72
51
uses : gradle/gradle-build-action@v2
73
- if : |
74
- !contains(steps.version.outputs.arrow, 'alpha') &&
75
- !contains(steps.version.outputs.arrow, 'beta') &&
76
- !contains(steps.version.outputs.arrow, 'rc')
77
- with :
78
- arguments : -Pkotlin.mpp.enableCompatibilityMetadataVariant=true publishToSonatype closeSonatypeStagingRepository
79
-
80
- - name : Prepare environment
81
- working-directory : arrow-site
82
- run : |
83
- mkdir $BASEDIR/logs
84
- brew install tree
85
- bundle config set --local path 'vendor/bundle'
86
- bundle install --gemfile Gemfile
87
-
88
- - name : Create API doc
89
- uses : gradle/gradle-build-action@v2
90
- with :
91
- arguments : -Pkotlin.mpp.enableCompatibilityMetadataVariant=true cleanDocs dokkaHtmlMultiModule
92
-
93
- - name : Build release directory (/docs)
94
- working-directory : arrow-site
95
- if : |
96
- !contains(steps.version.outputs.arrow, 'alpha') &&
97
- !contains(steps.version.outputs.arrow, 'beta') &&
98
- !contains(steps.version.outputs.arrow, 'rc')
99
- run : |
100
- bundle exec jekyll build -b docs -s docs
101
- tree _site > $BASEDIR/logs/content_docs-${{ steps.version.outputs.arrow }}.log
102
-
103
- - name : Publish documentation (/docs)
104
- working-directory : arrow-site
105
- if : |
106
- !contains(steps.version.outputs.arrow, 'alpha') &&
107
- !contains(steps.version.outputs.arrow, 'beta') &&
108
- !contains(steps.version.outputs.arrow, 'rc')
109
- run : |
110
- echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log
111
- ${GITHUB_WORKSPACE}/.github/scripts/sync-docs-with-aws.sh
112
-
113
- - name : Build release directory (/docs/<major.minor>)
114
- working-directory : arrow-site
115
- if : |
116
- !contains(steps.version.outputs.arrow, 'alpha') &&
117
- !contains(steps.version.outputs.arrow, 'beta') &&
118
- !contains(steps.version.outputs.arrow, 'rc')
119
- run : |
120
- bundle exec jekyll build -b docs/${{ steps.version.outputs.arrow }} -s docs
121
- tree _site > $BASEDIR/logs/content_docs-${{ steps.version.outputs.arrow }}.log
122
-
123
- - name : Publish release directory (/docs/<major.minor>)
124
- working-directory : arrow-site
125
- if : |
126
- !contains(steps.version.outputs.arrow, 'alpha') &&
127
- !contains(steps.version.outputs.arrow, 'beta') &&
128
- !contains(steps.version.outputs.arrow, 'rc')
129
- run : |
130
- aws s3 sync _site s3://$S3_BUCKET/docs/${{ steps.version.outputs.arrow }} --delete --exclude "/CNAME" --exclude "/code/*" --exclude "/index.html" --exclude "/redirects.json" >> $BASEDIR/logs/aws_sync.log
131
-
132
- - name : Build latest version (/docs/next)
133
- working-directory : arrow-site
134
- run : |
135
- bundle exec jekyll build -b docs/next -s docs
136
- tree _site > $BASEDIR/logs/content_docs-next.log
137
-
138
- - name : Publish latest version (/docs/next)
139
- working-directory : arrow-site
140
- run : |
141
- aws s3 sync _site s3://$S3_BUCKET/docs/next --delete --exclude "/CNAME" --exclude "/code/*" --exclude "/index.html" --exclude "/redirects.json" >> $BASEDIR/logs/aws_sync.log
142
-
143
- - name : Publish sitemap.xml
144
- if : |
145
- !contains(steps.version.outputs.arrow, 'alpha') &&
146
- !contains(steps.version.outputs.arrow, 'beta') &&
147
- !contains(steps.version.outputs.arrow, 'rc')
148
- run : |
149
- ${GITHUB_WORKSPACE}/.github/scripts/create-sitemap.sh > sitemap.xml
150
- aws s3 cp sitemap.xml s3://$S3_BUCKET/sitemap.xml >> $BASEDIR/logs/aws_sync.log
151
-
152
- - name : Invalidate CloudFront cache
153
- run : aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_ID --paths "/*"
154
-
155
- - name : List S3
156
- run : aws s3 ls s3://$S3_BUCKET --recursive --summarize > $BASEDIR/logs/site-content.log
157
-
158
- - uses : actions/upload-artifact@v3
159
52
with :
160
- name : logs
161
- path : arrow-libs/logs.
53
+ arguments : -Pkotlin.mpp.enableCompatibilityMetadataVariant=true -Pversion=${{ inputs.version }} publishToSonatype closeSonatypeStagingRepository
0 commit comments