From c30443cee5a18e12a5fcaeffa38530ee5b5842f3 Mon Sep 17 00:00:00 2001 From: Anatolii Date: Tue, 10 Mar 2020 14:13:30 +0100 Subject: [PATCH] Use GitHub Actions to release nightly builds --- .drone.yml | 94 +++++++++++++++++------------------ .github/workflows/ci.yaml | 101 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 143 insertions(+), 52 deletions(-) diff --git a/.drone.yml b/.drone.yml index 59d5d6afa527..b38367bb85b6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -91,53 +91,53 @@ steps: - tag - promote -- name: publish_nightly - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: - - test - - test_bootstrapped - - community_build - - test_sbt - - test_java11 - commands: - - ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease" - environment: - NIGHTLYBUILD: yes - PGP_PW: - from_secret: pgp_pw - PGP_SECRET: - from_secret: pgp_secret - SONATYPE_PW: - from_secret: sonatype_pw - SONATYPE_USER: - from_secret: sonatype_user - when: - event: - - promote - target: - - nightly - -- name: nightly_documentation - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: - - test - - test_bootstrapped - - community_build - - test_java11 - - publish_nightly - commands: - - ./project/scripts/genDocs -doc-snapshot - environment: - BOT_TOKEN: - from_secret: bot_token - NIGHTLYBUILD: yes - when: - event: - - promote - target: - - nightly +# - name: publish_nightly +# pull: default +# image: lampepfl/dotty:2020-01-22-2 +# depends_on: +# - test +# - test_bootstrapped +# - community_build +# - test_sbt +# - test_java11 +# commands: +# - ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease" +# environment: +# NIGHTLYBUILD: yes +# PGP_PW: +# from_secret: pgp_pw +# PGP_SECRET: +# from_secret: pgp_secret +# SONATYPE_PW: +# from_secret: sonatype_pw +# SONATYPE_USER: +# from_secret: sonatype_user +# when: +# event: +# - promote +# target: +# - nightly + +# - name: nightly_documentation +# pull: default +# image: lampepfl/dotty:2020-01-22-2 +# depends_on: +# - test +# - test_bootstrapped +# - community_build +# - test_java11 +# - publish_nightly +# commands: +# - ./project/scripts/genDocs -doc-snapshot +# environment: +# BOT_TOKEN: +# from_secret: bot_token +# NIGHTLYBUILD: yes +# when: +# event: +# - promote +# target: +# - nightly - name: publish_release pull: default diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 80e8cfe09ead..bd0cddca3bd0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,10 @@ name: Dotty CI -on: [push, pull_request] +on: + push: + pull_request: + schedule: + - cron: '0 3 * * *' # Every day at 3 AM env: DOTTY_CI_RUN: true @@ -112,8 +116,11 @@ jobs: test_sbt: runs-on: self-hosted container: akmetiuk/dotty:2020-02-12 - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') + if: ( + github.event_name == 'push' && + startsWith(github.event.ref, 'refs/tags/') + ) || + github.event_name == 'schedule' steps: - name: Git Checkout @@ -146,8 +153,11 @@ jobs: test_java11: runs-on: self-hosted container: akmetiuk/dotty:2020-02-12 - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') + if: ( + github.event_name == 'push' && + startsWith(github.event.ref, 'refs/tags/') + ) || + github.event_name == 'schedule' steps: - name: Git Checkout @@ -178,3 +188,84 @@ jobs: run: | export PATH="/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH" ./project/scripts/sbt ";compile ;test" + + publish_nightly: + runs-on: self-hosted + container: akmetiuk/dotty:2020-02-12 + needs: [test, test_bootstrapped, community_build, test_sbt, test_java11] + if: github.event_name == 'schedule' + env: + NIGHTLYBUILD: yes + PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase + PGP_SECRET: ${{ secrets.PGP_SECRET }} # Export your private and public PGP key to an *.asc file, take the file's contents as a string + SONATYPE_PW: ${{ secrets.SONATYPE_PW }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + + steps: + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Cache Ivy + uses: actions/cache@v1.1.2 + with: + path: /root/.ivy2/cache + key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }} + restore-keys: ${{ runner.os }}-ivy- + + - name: Cache SBT + uses: actions/cache@v1.1.2 + with: + path: /root/.sbt + key: ${{ runner.os }}-sbt-${{ hashFiles('project/**') }} + restore-keys: ${{ runner.os }}-sbt- + + - name: Cache Coursier and Mill + uses: actions/cache@v1.1.2 + with: + path: /root/.cache + key: ${{ runner.os }}-general-${{ hashFiles('**/build.sbt') }} + restore-keys: ${{ runner.os }}-general- + + - name: Publish Nightly + run: | + ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease" + + nightly_documentation: + runs-on: self-hosted + container: akmetiuk/dotty:2020-02-12 + needs: [publish_nightly] + if: github.event_name == 'schedule' + env: + NIGHTLYBUILD: yes + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} # If you need to change this: + # Generate one at https://github.com/settings/tokens + # Make sure you have the write permissions to the repo: https://github.com/lampepfl/dotty-website + + steps: + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Cache Ivy + uses: actions/cache@v1.1.2 + with: + path: /root/.ivy2/cache + key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }} + restore-keys: ${{ runner.os }}-ivy- + + - name: Cache SBT + uses: actions/cache@v1.1.2 + with: + path: /root/.sbt + key: ${{ runner.os }}-sbt-${{ hashFiles('project/**') }} + restore-keys: ${{ runner.os }}-sbt- + + - name: Cache Coursier and Mill + uses: actions/cache@v1.1.2 + with: + path: /root/.cache + key: ${{ runner.os }}-general-${{ hashFiles('**/build.sbt') }} + restore-keys: ${{ runner.os }}-general- + + - name: Nightly Documentation + run: | + ./project/scripts/genDocs -doc-snapshot