Skip to content

Commit

Permalink
Configuration: remove Bintray (step 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelcarmena committed Apr 1, 2021
1 parent 12f047b commit 995bedc
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 69 deletions.
12 changes: 12 additions & 0 deletions .github/scripts/set-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -ex

echo "$JAVA_HOME_8_X64/bin" >> $GITHUB_PATH
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
LATEST_PUBLISHED_VERSION=$(curl -L https://repo1.maven.org/maven2/io/arrow-kt/arrow-core/maven-metadata.xml | ggrep -oP '<latest>\K[^<]*')
if [ "$LATEST_PUBLISHED_VERSION" == "" ]; then exit 1; fi
RELEASE_VERSION=$(grep LATEST_VERSION $BASEDIR/gradle.properties | cut -d= -f2)
echo "LATEST_PUBLISHED_VERSION=$LATEST_PUBLISHED_VERSION" >> $GITHUB_ENV
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "NEW_RELEASE_VERSION_EXISTS="$([ "$LATEST_PUBLISHED_VERSION" == "$RELEASE_VERSION" ] && echo '0' || echo '1') >> $GITHUB_ENV
7 changes: 7 additions & 0 deletions .github/scripts/show-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

echo "LATEST_PUBLISHED_VERSION: $LATEST_PUBLISHED_VERSION"
echo "RELEASE_VERSION: $RELEASE_VERSION"
echo "NEW_RELEASE_VERSION_EXISTS: $NEW_RELEASE_VERSION_EXISTS"
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ jobs:
build:

env:
BASEDIR: ${{github.workspace}}/arrow-libs
JAVA_OPTS: -Xms512m -Xmx1024m

runs-on: macos-latest
timeout-minutes: 60

steps:
- name: Set env
run: |
echo "$JAVA_HOME_8_X64/bin" >> $GITHUB_PATH
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- 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: Build
working-directory: arrow-libs
run: ./gradlew build
17 changes: 10 additions & 7 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@ jobs:
build_doc:

env:
BASEDIR: ${{github.workspace}}/arrow-libs
JAVA_OPTS: -Xms512m -Xmx1024m

runs-on: macos-latest
timeout-minutes: 60

steps:
- name: Set env
run: |
echo "$JAVA_HOME_8_X64/bin" >> $GITHUB_PATH
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create APIdoc
- 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: "Create APIdoc"
working-directory: arrow-libs
run: ./gradlew dokka
- name: Validate documentation
- name: "Validate documentation"
working-directory: arrow-site
run: ./gradlew runAnk
- name: Build site
- name: "Build site"
working-directory: arrow-site
run: |
bundle install --gemfile Gemfile --path vendor/bundle
Expand Down
36 changes: 13 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,31 @@ jobs:
runs-on: macos-latest

steps:
- name: Set env
run: |
echo "$JAVA_HOME_8_X64/bin" >> $GITHUB_PATH
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Check versions"
id: versions
run: |
LATEST_PUBLISHED_RELEASE_VERSION=$(curl -X GET https://api.bintray.com/packages/arrow-kt/arrow-kt/arrow/versions/_latest | jq -r '.name')
RELEASE_VERSION=$(grep LATEST_VERSION $BASEDIR/gradle.properties | cut -d= -f2)
NEW_RELEASE_VERSION_EXISTS=$([ "$LATEST_PUBLISHED_RELEASE_VERSION" == "$RELEASE_VERSION" ] && echo '0' || echo '1')
echo "::set-output name=latest-published-release-version::$LATEST_PUBLISHED_RELEASE_VERSION"
echo "::set-output name=release-version::$RELEASE_VERSION"
echo "::set-output name=new-release-version-exists::$NEW_RELEASE_VERSION_EXISTS"
- 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: "Update version when release"
if: steps.versions.outputs.new-release-version-exists == '1'
run: perl -pe "s/^VERSION_NAME=.*/VERSION_NAME=${{ steps.versions.outputs.release-version }}/g" -i $BASEDIR/gradle.properties
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
run: perl -pe "s/^VERSION_NAME=.*/VERSION_NAME=$RELEASE_VERSION/g" -i $BASEDIR/gradle.properties
- name: "Publish"
working-directory: arrow-libs
run: |
./gradlew publish
echo "$(cat $BASEDIR/gradle.properties | grep VERSION_NAME | cut -d'=' -f2) deployed!"
- name: "Create tag"
if: steps.versions.outputs.new-release-version-exists == '1'
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
run: |
git remote set-url origin https://arrow-kt:[email protected]/arrow-kt/arrow.git
git config --global user.email "[email protected]"
git config --global user.name "arrow-kt"
git tag -a ${{ steps.versions.outputs.release-version }} -m "Release ${{ steps.versions.outputs.release-version }}"
git push origin ${{ steps.versions.outputs.release-version }}
git tag -a $RELEASE_VERSION -m "Release $RELEASE_VERSION"
git push origin $RELEASE_VERSION
- name: "Create release notes"
if: steps.versions.outputs.new-release-version-exists == '1'
run: |
export LATEST_PUBLISHED_VERSION=${{ steps.versions.outputs.latest-published-release-version }}
export RELEASE_VERSION=${{ steps.versions.outputs.release-version }}
.github/scripts/create-release-notes.sh
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
run: ${GITHUB_WORKSPACE}/.github/scripts/create-release-notes.sh
22 changes: 8 additions & 14 deletions .github/workflows/publish_arrow-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,15 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set env
run: |
echo "$JAVA_HOME_8_X64/bin" >> $GITHUB_PATH
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- name: "Check versions"
id: versions
run: |
LATEST_PUBLISHED_RELEASE_VERSION=$(curl -X GET https://api.bintray.com/packages/arrow-kt/arrow-kt/arrow/versions/_latest | jq -r '.name')
RELEASE_VERSION=$(grep LATEST_VERSION $BASEDIR/gradle.properties | cut -d= -f2)
NEW_RELEASE_VERSION_EXISTS=$([ "$LATEST_PUBLISHED_RELEASE_VERSION" == "$RELEASE_VERSION" ] && echo '0' || echo '1')
echo "::set-output name=release-version::$RELEASE_VERSION"
echo "::set-output name=new-release-version-exists::$NEW_RELEASE_VERSION_EXISTS"
- 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: "Update version when release"
if: steps.versions.outputs.new-release-version-exists == '1'
run: perl -pe "s/^VERSION_NAME=.*/VERSION_NAME=${{ steps.versions.outputs.release-version }}/g" -i $BASEDIR/gradle.properties
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
run: perl -pe "s/^VERSION_NAME=.*/VERSION_NAME=$RELEASE_VERSION/g" -i $BASEDIR/gradle.properties
- name: "Publish"
run: |
./gradlew publish
Expand Down
32 changes: 13 additions & 19 deletions .github/workflows/publish_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,15 @@ jobs:
timeout-minutes: 60

steps:
- name: Set env
run: |
echo "$JAVA_HOME_8_X64/bin" >> $GITHUB_PATH
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Check versions"
id: versions
run: |
LATEST_PUBLISHED_RELEASE_VERSION=$(curl -X GET https://api.bintray.com/packages/arrow-kt/arrow-kt/arrow/versions/_latest | jq -r '.name')
RELEASE_VERSION=$(grep LATEST_VERSION $BASEDIR/gradle.properties | cut -d= -f2)
NEW_RELEASE_VERSION_EXISTS=$([ "$LATEST_PUBLISHED_RELEASE_VERSION" == "$RELEASE_VERSION" ] && echo '0' || echo '1')
echo "::set-output name=latest-published-release-version::$LATEST_PUBLISHED_RELEASE_VERSION"
echo "::set-output name=release-version::$RELEASE_VERSION"
echo "::set-output name=new-release-version-exists::$NEW_RELEASE_VERSION_EXISTS"
- 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: |
Expand All @@ -55,13 +48,13 @@ jobs:
working-directory: arrow-site
run: ./gradlew runAnk
- name: "Latest release: build (landing page + docs/)"
if: steps.versions.outputs.new-release-version-exists == '1'
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
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 (landing page + docs/)"
if: steps.versions.outputs.new-release-version-exists == '1'
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
working-directory: arrow-site
run: |
echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log
Expand All @@ -70,17 +63,17 @@ jobs:
working-directory: arrow-site
run: rm -f build/site/index.md
- name: "Latest release: build release directory (docs/<major.minor>)"
if: steps.versions.outputs.new-release-version-exists == '1'
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
working-directory: arrow-site
run: |
SHORT_VERSION=$(echo ${{ steps.versions.outputs.release-version }} | cut -d. -f1-2)
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: steps.versions.outputs.new-release-version-exists == '1'
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
working-directory: arrow-site
run: |
SHORT_VERSION=$(echo ${{ steps.versions.outputs.release-version }} | cut -d. -f1-2)
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
Expand All @@ -98,6 +91,7 @@ jobs:
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'
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
Expand Down
2 changes: 1 addition & 1 deletion arrow-libs/ank/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildscript {
repositories {
// ...
maven { url "https://dl.bintray.com/arrow-kt/arrow-kt/" }
mavenCentral()
}
dependencies {
Expand Down
1 change: 0 additions & 1 deletion arrow-libs/gradle/main.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ allprojects {
repositories {
jcenter() // TODO: Needed by Dokka for org.jetbrains.dokka.gradle.DokkaTask.tryResolveFatJar - update version to remove it!
mavenCentral()
maven { url 'https://kotlin.bintray.com/kotlinx' }
}
}

0 comments on commit 995bedc

Please sign in to comment.