Skip to content

Commit 29505ae

Browse files
author
Holger Brandl
committed
Added more build and release automation
1 parent 9d80f85 commit 29505ae

File tree

4 files changed

+87
-4
lines changed

4 files changed

+87
-4
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
- name: Set up JDK 11
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 11
22+
- name: Grant execute permission for gradlew
23+
run: chmod +x gradlew
24+
- name: Build and test with Gradle
25+
# https://stackoverflow.com/questions/50104666/gradle-difference-between-test-and-check
26+
# https://stackoverflow.com/questions/50104666/gradle-difference-between-test-and-check
27+
run: ./gradlew clean check --stacktrace --info

.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/krangl/blob/master/CHANGES.md) for new features, bug-fixes and changes.
40+
draft: false
41+
prerelease: false

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ Support API for `kscript`
22
=========================
33

44

5-
[![Build Status](https://travis-ci.org/holgerbrandl/kscript-support-api.svg?branch=master)](https://travis-ci.org/holgerbrandl/kscript-support-api) [ ![Download](https://api.bintray.com/packages/holgerbrandl/github/kscript/images/download.svg) ](https://bintray.com/holgerbrandl/github/kscript/_latestVersion)[](https://bintray.com/)
6-
5+
[ ![Download](https://img.shields.io/badge/Maven%20Central-1.2.5-orange) ](https://mvnrepository.com/artifact/com.github.holgerbrandl/kscript-support-api) [![Build Status](https://github.com/holgerbrandl/krangl/workflows/build/badge.svg)](https://github.com/holgerbrandl/kscript-support-api/actions?query=workflow%3Abuild)
76

87

98

@@ -27,7 +26,7 @@ Even if the artifact is intended to be used alongside with `kscript` you can als
2726

2827
To get started simply add it as a dependency via Jcenter:
2928
```
30-
compile "com.github.holgerbrandl:kscript-support:1.2.4"
29+
compile "com.github.holgerbrandl:kscript-support:1.2.5"
3130
```
3231

3332

suport_api_notes.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Release Checklist
2121
* `kscript-support-api/README`
2222
* `kscript/README`
2323

24-
# How to publish a new version?
2524

25+
2. Do the central release
2626
```bash
2727
# cd /c/brandl_data/projects/misc/kscript-support-api
2828

@@ -34,6 +34,22 @@ Release Checklist
3434
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
3535
```
3636

37+
3. Do the github source release
38+
39+
```bash
40+
41+
# make sure that are no pending chanes
42+
#(git diff --exit-code && git tag v${kscript_version}) || echo "could not tag current branch"
43+
git diff --exit-code || echo "There are uncommitted changes"
44+
45+
46+
git tag "1.2.5"
47+
48+
git push origin
49+
git push origin --tags
50+
```
51+
52+
3753
Links
3854
-----
3955

0 commit comments

Comments
 (0)