Skip to content

Commit e1e6591

Browse files
authored
Update Github Workflow (#3024)
1 parent 879e173 commit e1e6591

8 files changed

+16
-331
lines changed

.github/workflows/auto-update-pr.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: auto-update-pr
22
on:
3-
push: {}
4-
branches-ignore:
5-
- main
3+
push:
4+
branches-ignore:
5+
- main
6+
67
jobs:
78
autoupdate:
89
name: Auto update PR

.github/workflows/generate-alpha-tag.yaml

-57
This file was deleted.

.github/workflows/generate-tag.yaml

-77
This file was deleted.

.github/workflows/githubpages.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: githubpages
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
release:
5+
types: [published]
76

87
env:
98
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"
@@ -20,7 +19,7 @@ jobs:
2019

2120
- name: Dokka
2221
id: Dokka
23-
run: ./gradlew cleanDocs dokkaHtmlMultiModule -Pgithubpages=true
22+
run: ./gradlew -Pversion=${{ github.event.release.tag_name }} cleanDocs dokkaHtmlMultiModule -Pgithubpages=true
2423

2524
- name: Deploy to gh-pages
2625
uses: peaceiris/actions-gh-pages@v3

.github/workflows/publish-landing-page.yaml

-71
This file was deleted.

.github/workflows/publish.yml

+9-117
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
name: "Publish all libs, Arrow-stack and Docs"
22

33
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
711

812
env:
913
BASEDIR: ${{github.workspace}}/arrow-libs
1014
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 }}
1515
OSS_USER: '${{ secrets.OSS_USER }}'
1616
OSS_TOKEN: '${{ secrets.OSS_TOKEN }}'
1717
OSS_STAGING_PROFILE_ID: '${{ secrets.OSS_STAGING_PROFILE_ID }}'
1818
SIGNING_KEY_NAME: '${{ secrets.SIGNING_KEY_NAME }}'
1919
SIGNING_KEY_ID: '${{ secrets.SIGNING_KEY_ID }}'
2020
SIGNING_KEY_PASSPHRASE: '${{ secrets.SIGNING_KEY_PASSPHRASE }}'
2121
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 }}
3022

3123
jobs:
3224
publish:
@@ -46,11 +38,7 @@ jobs:
4638
- name: assemble
4739
uses: gradle/gradle-build-action@v2
4840
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
5442

5543
- name: Upload reports
5644
if: failure()
@@ -59,103 +47,7 @@ jobs:
5947
name: 'reports-${{ matrix.os }}'
6048
path: '**/build/reports/**'
6149

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-
7150
- name: Publish final version
7251
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
15952
with:
160-
name: logs
161-
path: arrow-libs/logs.
53+
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true -Pversion=${{ inputs.version }} publishToSonatype closeSonatypeStagingRepository

0 commit comments

Comments
 (0)