Skip to content

Commit 02d6484

Browse files
Add SBT Plugin release logic to GH Actions CI
1 parent cf99851 commit 02d6484

File tree

2 files changed

+80
-28
lines changed

2 files changed

+80
-28
lines changed

.drone.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -202,32 +202,32 @@ steps:
202202
# event:
203203
# - tag
204204

205-
- name: publish_sbt_release
206-
pull: default
207-
image: lampepfl/dotty:2020-01-22-2
208-
depends_on:
209-
- test
210-
- test_bootstrapped
211-
- community_build
212-
- test_sbt
213-
- test_java11
214-
commands:
215-
- ./project/scripts/sbtPublish ";project sbt-dotty ;publishSigned ;sonatypeBundleRelease"
216-
environment:
217-
PGP_PW:
218-
from_secret: pgp_pw
219-
PGP_SECRET:
220-
from_secret: pgp_secret
221-
RELEASEBUILD: yes
222-
SONATYPE_PW:
223-
from_secret: sonatype_pw
224-
SONATYPE_USER:
225-
from_secret: sonatype_user
226-
when:
227-
event:
228-
- promote
229-
target:
230-
- sbt_release
205+
# - name: publish_sbt_release
206+
# pull: default
207+
# image: lampepfl/dotty:2020-01-22-2
208+
# depends_on:
209+
# - test
210+
# - test_bootstrapped
211+
# - community_build
212+
# - test_sbt
213+
# - test_java11
214+
# commands:
215+
# - ./project/scripts/sbtPublish ";project sbt-dotty ;publishSigned ;sonatypeBundleRelease"
216+
# environment:
217+
# PGP_PW:
218+
# from_secret: pgp_pw
219+
# PGP_SECRET:
220+
# from_secret: pgp_secret
221+
# RELEASEBUILD: yes
222+
# SONATYPE_PW:
223+
# from_secret: sonatype_pw
224+
# SONATYPE_USER:
225+
# from_secret: sonatype_user
226+
# when:
227+
# event:
228+
# - promote
229+
# target:
230+
# - sbt_release
231231

232232
- name: slack
233233
pull: default

.github/workflows/ci.yaml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ jobs:
317317
container: akmetiuk/dotty:2020-02-12
318318
needs: [test, test_bootstrapped, community_build, test_sbt, test_java11]
319319
if: github.event_name == 'push' &&
320-
startsWith(github.event.ref, 'refs/tags/')
320+
startsWith(github.event.ref, 'refs/tags/') &&
321+
!startsWith(github.ref, "sbt-dotty-")
321322

322323
env:
323324
RELEASEBUILD: yes
@@ -410,7 +411,9 @@ jobs:
410411
container: akmetiuk/dotty:2020-02-12
411412
needs: [publish_release]
412413
if: github.event_name == 'push' &&
413-
startsWith(github.event.ref, 'refs/tags/')
414+
startsWith(github.event.ref, 'refs/tags/') &&
415+
!startsWith(github.ref, "sbt-dotty-")
416+
414417
env:
415418
RELEASEBUILD: yes
416419
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} # If you need to change this:
@@ -452,3 +455,52 @@ jobs:
452455
run: |
453456
./project/scripts/genDocs -doc-snapshot
454457
458+
publish_sbt_release:
459+
runs-on: self-hosted
460+
container: akmetiuk/dotty:2020-02-12
461+
needs: [test, test_bootstrapped, community_build, test_sbt, test_java11]
462+
if: github.event_name == 'push' &&
463+
startsWith(github.event.ref, 'refs/tags/') &&
464+
startsWith(github.ref, "sbt-dotty-")
465+
466+
env:
467+
RELEASEBUILD: yes
468+
PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase
469+
PGP_SECRET: ${{ secrets.PGP_SECRET }} # Export your private and public PGP key to an *.asc file, take the file's contents as a string
470+
SONATYPE_PW: ${{ secrets.SONATYPE_PW }}
471+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
472+
473+
steps:
474+
- name: Checkout cleanup script
475+
uses: actions/checkout@v2
476+
477+
- name: Cleanup
478+
run: .github/workflows/cleanup.sh
479+
480+
- name: Git Checkout
481+
uses: actions/checkout@v2
482+
483+
- name: Cache Ivy
484+
uses: actions/[email protected]
485+
with:
486+
path: /root/.ivy2/cache
487+
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
488+
restore-keys: ${{ runner.os }}-ivy-
489+
490+
- name: Cache SBT
491+
uses: actions/[email protected]
492+
with:
493+
path: /root/.sbt
494+
key: ${{ runner.os }}-sbt-${{ hashFiles('project/**') }}
495+
restore-keys: ${{ runner.os }}-sbt-
496+
497+
- name: Cache Coursier and Mill
498+
uses: actions/[email protected]
499+
with:
500+
path: /root/.cache
501+
key: ${{ runner.os }}-general-${{ hashFiles('**/build.sbt') }}
502+
restore-keys: ${{ runner.os }}-general-
503+
504+
- name: Publish Dotty SBT Plugin Release
505+
run: |
506+
./project/scripts/sbtPublish ";project sbt-dotty ;publishSigned ;sonatypeBundleRelease"

0 commit comments

Comments
 (0)