Skip to content

Commit

Permalink
Update Github Workflow (#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisRev committed Apr 3, 2023
1 parent 879e173 commit e1e6591
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 331 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/auto-update-pr.yaml
@@ -1,8 +1,9 @@
name: auto-update-pr
on:
push: {}
branches-ignore:
- main
push:
branches-ignore:
- main

jobs:
autoupdate:
name: Auto update PR
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/generate-alpha-tag.yaml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/generate-tag.yaml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/githubpages.yaml
@@ -1,9 +1,8 @@
name: githubpages

on:
push:
branches:
- main
release:
types: [published]

env:
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"
Expand All @@ -20,7 +19,7 @@ jobs:

- name: Dokka
id: Dokka
run: ./gradlew cleanDocs dokkaHtmlMultiModule -Pgithubpages=true
run: ./gradlew -Pversion=${{ github.event.release.tag_name }} cleanDocs dokkaHtmlMultiModule -Pgithubpages=true

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/publish-landing-page.yaml

This file was deleted.

126 changes: 9 additions & 117 deletions .github/workflows/publish.yml
@@ -1,32 +1,24 @@
name: "Publish all libs, Arrow-stack and Docs"

on:
push:
tags:
- '**'
workflow_dispatch:
branches: [main]
inputs:
version:
description: 'Version'
required: true
type: string

env:
BASEDIR: ${{github.workspace}}/arrow-libs
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"
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 }}
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 }}'
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 }}
JEKYLL_ENV: production
S3_BUCKET: ${{ secrets.S3_BUCKET }}

jobs:
publish:
Expand All @@ -46,11 +38,7 @@ jobs:
- name: assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble -Pkotlin.mpp.enableCompatibilityMetadataVariant=true

- name: Get Arrow version
id: version
run: echo "::set-output name=arrow::$(head -n 1 build/semver/version.txt)"
arguments: assemble -Pversion=${{ inputs.version }} -Pkotlin.mpp.enableCompatibilityMetadataVariant=true

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

- name: Publish alpha/beta/rc version
uses: gradle/gradle-build-action@v2
if: |
contains(steps.version.outputs.arrow, 'alpha') ||
contains(steps.version.outputs.arrow, 'beta') ||
contains(steps.version.outputs.arrow, 'rc')
with:
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true publishToSonatype closeAndReleaseSonatypeStagingRepository

- name: Publish final version
uses: gradle/gradle-build-action@v2
if: |
!contains(steps.version.outputs.arrow, 'alpha') &&
!contains(steps.version.outputs.arrow, 'beta') &&
!contains(steps.version.outputs.arrow, 'rc')
with:
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true publishToSonatype closeSonatypeStagingRepository

- 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
uses: gradle/gradle-build-action@v2
with:
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true cleanDocs dokkaHtmlMultiModule

- name: Build release directory (/docs)
working-directory: arrow-site
if: |
!contains(steps.version.outputs.arrow, 'alpha') &&
!contains(steps.version.outputs.arrow, 'beta') &&
!contains(steps.version.outputs.arrow, 'rc')
run: |
bundle exec jekyll build -b docs -s docs
tree _site > $BASEDIR/logs/content_docs-${{ steps.version.outputs.arrow }}.log
- name: Publish documentation (/docs)
working-directory: arrow-site
if: |
!contains(steps.version.outputs.arrow, 'alpha') &&
!contains(steps.version.outputs.arrow, 'beta') &&
!contains(steps.version.outputs.arrow, 'rc')
run: |
echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log
${GITHUB_WORKSPACE}/.github/scripts/sync-docs-with-aws.sh
- name: Build release directory (/docs/<major.minor>)
working-directory: arrow-site
if: |
!contains(steps.version.outputs.arrow, 'alpha') &&
!contains(steps.version.outputs.arrow, 'beta') &&
!contains(steps.version.outputs.arrow, 'rc')
run: |
bundle exec jekyll build -b docs/${{ steps.version.outputs.arrow }} -s docs
tree _site > $BASEDIR/logs/content_docs-${{ steps.version.outputs.arrow }}.log
- name: Publish release directory (/docs/<major.minor>)
working-directory: arrow-site
if: |
!contains(steps.version.outputs.arrow, 'alpha') &&
!contains(steps.version.outputs.arrow, 'beta') &&
!contains(steps.version.outputs.arrow, 'rc')
run: |
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
- name: Build latest version (/docs/next)
working-directory: arrow-site
run: |
bundle exec jekyll build -b docs/next -s docs
tree _site > $BASEDIR/logs/content_docs-next.log
- name: Publish latest version (/docs/next)
working-directory: arrow-site
run: |
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
- name: Publish sitemap.xml
if: |
!contains(steps.version.outputs.arrow, 'alpha') &&
!contains(steps.version.outputs.arrow, 'beta') &&
!contains(steps.version.outputs.arrow, 'rc')
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: Invalidate CloudFront cache
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@v3
with:
name: logs
path: arrow-libs/logs.
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true -Pversion=${{ inputs.version }} publishToSonatype closeSonatypeStagingRepository

0 comments on commit e1e6591

Please sign in to comment.