Skip to content

Commit 6b0d4ea

Browse files
committed
started github actions for better release automation
1 parent 46dda89 commit 6b0d4ea

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build
2+
3+
# https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/adding-a-workflow-status-badge
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
# https://stackoverflow.com/questions/56726429/how-to-run-multiple-commands-in-one-github-actions-docker
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 11
23+
- run: |
24+
apt-get update
25+
apt-get install -y python-software-properties
26+
apt-get install -y curl unzip zip wget
27+
bash -c "curl -s "https://get.sdkman.io" | bash"
28+
source "/home/travis/.sdkman/bin/sdkman-init.sh"
29+
- run: sdk install kotlin
30+
- run: sdk install gradle
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x gradlew
33+
- name: Build and test with Gradle
34+
# https://stackoverflow.com/questions/50104666/gradle-difference-between-test-and-check
35+
# https://stackoverflow.com/questions/50104666/gradle-difference-between-test-and-check
36+
run: ./gradlew clean check --stacktrace --info
37+
- env:
38+
# https://docs.github.com/en/actions/reference/environment-variables
39+
KSCRIPT_HOME: $GITHUB_WORKSPACE
40+
- run: cd $KSCRIPT_HOME && ./gradlew assemble
41+
# install assert.h
42+
- run: get https://raw.github.com/lehmannro/assert.sh/v1.1/assert.sh && chmod +x assert.sh
43+
- run: which kscript
44+
- run: kscript --version
45+
- run: touch idea && chmod +x idea
46+
- run: cd $KSCRIPT_HOME && ./test/test_suite.sh

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Created with https://github.com/marketplace/actions/create-a-release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
# branches:
7+
# - master
8+
tags:
9+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
10+
11+
name: Create Release
12+
13+
14+
jobs:
15+
build:
16+
name: Create Release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
# https://github.community/t/accessing-commit-message-in-pull-request-event/17158/8
22+
# - name: get commit message
23+
# run: |
24+
# echo ::set-env name=commitmsg::$(git log --format=%B -n 1 ${{ github.event.after }})
25+
# - name: show commit message
26+
# run: echo $commitmsg
27+
- name: Create Release
28+
id: create_release
29+
uses: actions/create-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
32+
with:
33+
# https://stackoverflow.com/questions/63619329/github-action-get-commit-message
34+
# tag_name: ${{ github.event.head_commit.message }}
35+
# release_name: ${{ github.event.head_commit.message }}
36+
tag_name: ${{ github.ref }}
37+
release_name: ${{ github.ref }}
38+
body: |
39+
See [CHANGES.md](https://github.com/holgerbrandl/kscript/blob/master/NEWS.md) for new features, bug-fixes and changes.
40+
draft: false
41+
prerelease: false

0 commit comments

Comments
 (0)