Skip to content

Commit cf99851

Browse files
GitHub Release creation logic added to CI workflow
1 parent 7de72d5 commit cf99851

File tree

2 files changed

+61
-17
lines changed

2 files changed

+61
-17
lines changed

.drone.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,22 +185,22 @@ steps:
185185
# event:
186186
# - tag
187187

188-
- name: github_release
189-
pull: default
190-
image: plugins/github-release
191-
depends_on: [ publish_release ]
192-
settings:
193-
checksum:
194-
- sha256
195-
draft: true
196-
files:
197-
- dist-bootstrapped/target/dotty-*
198-
environment:
199-
GITHUB_TOKEN:
200-
from_secret: github_token
201-
when:
202-
event:
203-
- tag
188+
# - name: github_release
189+
# pull: default
190+
# image: plugins/github-release
191+
# depends_on: [ publish_release ]
192+
# settings:
193+
# checksum:
194+
# - sha256
195+
# draft: true
196+
# files:
197+
# - dist-bootstrapped/target/dotty-*
198+
# environment:
199+
# GITHUB_TOKEN:
200+
# from_secret: github_token
201+
# when:
202+
# event:
203+
# - tag
204204

205205
- name: publish_sbt_release
206206
pull: default

.github/workflows/ci.yaml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,54 @@ jobs:
357357
key: ${{ runner.os }}-general-${{ hashFiles('**/build.sbt') }}
358358
restore-keys: ${{ runner.os }}-general-
359359

360-
- name: Publish Nightly
360+
- name: Publish Release
361361
run: |
362362
./project/scripts/sbt dist-bootstrapped/packArchive
363+
sha256sum dist-bootstrapped/target/dotty-* > dist-bootstrapped/target/sha256sum.txt
363364
./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease"
364365
366+
- name: Create GitHub Release
367+
id: create_gh_release
368+
uses: actions/create-release@latest
369+
env:
370+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
371+
with:
372+
tag_name: ${{ github.ref }}
373+
release_name: ${{ github.ref }}
374+
body:
375+
draft: false
376+
prerelease: ${{ endsWith(github.ref, "RC-1") }}
377+
378+
- name: Upload zip archive to GitHub Release
379+
uses: actions/upload-release-asset@v1
380+
env:
381+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
382+
with:
383+
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
384+
asset_path: ./dist-bootstrapped/target/dotty-${{ github.ref }}.zip
385+
asset_name: dotty-${{ github.ref }}.zip
386+
asset_content_type: application/zip
387+
388+
- name: Upload tar.gz archive to GitHub Release
389+
uses: actions/upload-release-asset@v1
390+
env:
391+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
392+
with:
393+
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
394+
asset_path: ./dist-bootstrapped/target/dotty-${{ github.ref }}.tar.gz
395+
asset_name: dotty-${{ github.ref }}.tar.gz
396+
asset_content_type: application/gzip
397+
398+
- name: Upload SHA256 sum of the release artefacts to GitHub Release
399+
uses: actions/upload-release-asset@v1
400+
env:
401+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
402+
with:
403+
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
404+
asset_path: ./dist-bootstrapped/target/sha256sum.txt
405+
asset_name: sha256sum.txt
406+
asset_content_type: text/plain
407+
365408
release_documentation:
366409
runs-on: self-hosted
367410
container: akmetiuk/dotty:2020-02-12
@@ -408,3 +451,4 @@ jobs:
408451
- name: Nightly Documentation
409452
run: |
410453
./project/scripts/genDocs -doc-snapshot
454+

0 commit comments

Comments
 (0)