diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index b38367bb85b6..000000000000 --- a/.drone.yml +++ /dev/null @@ -1,248 +0,0 @@ ---- -kind: pipeline -name: default - -platform: - os: linux - arch: amd64 - -clone: - disable: true - -steps: -- name: git - pull: default - image: plugins/git - -- name: clone - pull: default - image: plugins/git - depends_on: [ git ] - commands: - - if [ "$DRONE_BUILD_EVENT" = "pull_request" ]; then - git config user.email "dotty.bot@epfl.ch"; - git config user.name "Dotty CI"; - git pull "$DRONE_REMOTE_URL" "$DRONE_BRANCH"; - fi - -- name: test - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: [ clone ] - commands: - - cp -R . /tmp/1/ && cd /tmp/1/ - - ./project/scripts/sbt ";compile ;test" - - ./project/scripts/cmdTests - when: - event: - - tag - - promote - - -- name: test_bootstrapped - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: [ clone ] - commands: - - cp -R . /tmp/2/ && cd /tmp/2/ - - ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test ;configureIDE" - - ./project/scripts/bootstrapCmdTests - when: - event: - - tag - - promote - -- name: community_build - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: [ clone ] - commands: - - cp -R . /tmp/3/ && cd /tmp/3/ - - git submodule sync - - git submodule update --init --recursive --jobs 7 - - ./project/scripts/sbt community-build/test - when: - event: - - tag - - promote - -- name: test_sbt - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: [ clone ] - commands: - - cp -R . /tmp/4/ && cd /tmp/4/ - - ./project/scripts/sbt sbt-dotty/scripted - when: - event: - - tag - - promote - -- name: test_java11 - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: [ clone ] - commands: - - export PATH="/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH" - - cp -R . /tmp/6/ && cd /tmp/6/ - - ./project/scripts/sbt ";compile ;test" - when: - event: - - 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_release - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: - - test - - test_bootstrapped - - community_build - - test_sbt - - test_java11 - commands: - - ./project/scripts/sbt dist-bootstrapped/packArchive - - ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease" - environment: - PGP_PW: - from_secret: pgp_pw - PGP_SECRET: - from_secret: pgp_secret - RELEASEBUILD: yes - SONATYPE_PW: - from_secret: sonatype_pw - SONATYPE_USER: - from_secret: sonatype_user - when: - event: - - tag - -- name: release_documentation - pull: default - image: lampepfl/dotty:2020-01-22-2 - depends_on: - - test - - test_bootstrapped - - community_build - - test_java11 - - publish_release - - github_release - commands: - - ./project/scripts/genDocs -doc-snapshot - environment: - BOT_TOKEN: - from_secret: bot_token - RELEASEBUILD: yes - when: - event: - - tag - -- name: github_release - pull: default - image: plugins/github-release - depends_on: [ publish_release ] - settings: - checksum: - - sha256 - draft: true - files: - - dist-bootstrapped/target/dotty-* - environment: - GITHUB_TOKEN: - from_secret: github_token - when: - event: - - tag - -- name: publish_sbt_release - 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 sbt-dotty ;publishSigned ;sonatypeBundleRelease" - environment: - PGP_PW: - from_secret: pgp_pw - PGP_SECRET: - from_secret: pgp_secret - RELEASEBUILD: yes - SONATYPE_PW: - from_secret: sonatype_pw - SONATYPE_USER: - from_secret: sonatype_user - when: - event: - - promote - target: - - sbt_release - -- name: slack - pull: default - image: plugins/slack - settings: - channel: dotty - environment: - SLACK_WEBHOOK: - from_secret: slack_webhook - when: - event: - - push - - tag - - promote - status: - - failure - -... diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 270dc1c7286f..33919661efa7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -311,3 +311,196 @@ jobs: - name: Nightly Documentation run: | ./project/scripts/genDocs -doc-snapshot + + publish_release: + runs-on: self-hosted + container: akmetiuk/dotty:2020-02-12 + needs: [test, test_bootstrapped, community_build, test_sbt, test_java11] + if: github.event_name == 'push' && + startsWith(github.event.ref, 'refs/tags/') && + !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + + env: + RELEASEBUILD: 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: Checkout cleanup script + uses: actions/checkout@v2 + + - name: Cleanup + run: .github/workflows/cleanup.sh + + - 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 Release + run: | + ./project/scripts/sbt dist-bootstrapped/packArchive + sha256sum dist-bootstrapped/target/dotty-* > dist-bootstrapped/target/sha256sum.txt + ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease" + echo "::set-env name=RELEASE_TAG::${GITHUB_REF#*refs/tags/}" + + - name: Create GitHub Release + id: create_gh_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: + draft: false + prerelease: ${{ contains(env.RELEASE_TAG, 'RC') }} + + - name: Upload zip archive to GitHub Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_gh_release.outputs.upload_url }} + asset_path: ./dist-bootstrapped/target/dotty-${{ env.RELEASE_TAG }}.zip + asset_name: dotty-${{ env.RELEASE_TAG }}.zip + asset_content_type: application/zip + + - name: Upload tar.gz archive to GitHub Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_gh_release.outputs.upload_url }} + asset_path: ./dist-bootstrapped/target/dotty-${{ env.RELEASE_TAG }}.tar.gz + asset_name: dotty-${{ env.RELEASE_TAG }}.tar.gz + asset_content_type: application/gzip + + - name: Upload SHA256 sum of the release artefacts to GitHub Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_gh_release.outputs.upload_url }} + asset_path: ./dist-bootstrapped/target/sha256sum.txt + asset_name: sha256sum.txt + asset_content_type: text/plain + + release_documentation: + runs-on: self-hosted + container: akmetiuk/dotty:2020-02-12 + needs: [publish_release] + if: github.event_name == 'push' && + startsWith(github.event.ref, 'refs/tags/') && + !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + + env: + RELEASEBUILD: 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: Checkout cleanup script + uses: actions/checkout@v2 + + - name: Cleanup + run: .github/workflows/cleanup.sh + + - 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 + + publish_sbt_release: + runs-on: self-hosted + container: akmetiuk/dotty:2020-02-12 + needs: [test, test_bootstrapped, community_build, test_sbt, test_java11] + if: github.event_name == 'push' && + startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + + env: + RELEASEBUILD: 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: Checkout cleanup script + uses: actions/checkout@v2 + + - name: Cleanup + run: .github/workflows/cleanup.sh + + - 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 Dotty SBT Plugin Release + run: | + ./project/scripts/sbtPublish ";project sbt-dotty ;publishSigned ;sonatypeBundleRelease" diff --git a/.github/workflows/cleanup.sh b/.github/workflows/cleanup.sh index 24211ff368a0..fe2a9bed3e59 100755 --- a/.github/workflows/cleanup.sh +++ b/.github/workflows/cleanup.sh @@ -6,8 +6,10 @@ for folder in $TARGETS; do for f in $(ls -a); do if [ "$f" != "." ] && [ "$f" != ".." ] && - [ "$f" != "_github_home" ] # __w/_temp/_github_home is mount as - # /github/home and is cleaned separately + [ "$f" != "_github_home" ] && # __w/_temp/_github_home is mount as + # /github/home and is cleaned separately + [ "$f" != "_github_workflow" ] # Contains workflow metadata, is needed + # for the correct workflow execution then rm -rf "$f" fi