Skip to content

Use GitHub Actions to release nightly builds #8496

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 11, 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 AM on which time zone?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UTC. From https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule:

You can schedule a workflow to run at specific UTC times using POSIX cron syntax.


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