Skip to content

Use GH Actions to publish nightlies #8562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
101 changes: 96 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
with:
path: /root/.ivy2/cache
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
restore-keys: ${{ runner.os }}-ivy-

- name: Cache SBT
uses: actions/[email protected]
with:
path: /root/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('project/**') }}
restore-keys: ${{ runner.os }}-sbt-

- name: Cache Coursier and Mill
uses: actions/[email protected]
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/[email protected]
with:
path: /root/.ivy2/cache
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
restore-keys: ${{ runner.os }}-ivy-

- name: Cache SBT
uses: actions/[email protected]
with:
path: /root/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('project/**') }}
restore-keys: ${{ runner.os }}-sbt-

- name: Cache Coursier and Mill
uses: actions/[email protected]
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
4 changes: 2 additions & 2 deletions project/scripts/sbtPublish
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fi

# Setup bouncycastle instead of gpg to do signing, because gpg explodes when
# doing too many signing requests in parallel (https://github.com/sbt/sbt-pgp/issues/168)
mkdir -p "$HOME/.sbt/gpg"
echo "$PGP_SECRET" > "$HOME/.sbt/gpg/secring.asc"
mkdir -p "/root/.sbt/gpg"
echo "$PGP_SECRET" > "/root/.sbt/gpg/secring.asc"

# run sbt with the supplied arg
SBT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/sbt"
Expand Down