Skip to content

Commit 96234e5

Browse files
committed
Update actions, add changelog to test build
1 parent 6d96da4 commit 96234e5

File tree

2 files changed

+70
-16
lines changed

2 files changed

+70
-16
lines changed

.github/workflows/changelog.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
# This is a basic workflow that is manually triggered
22

3-
name: Manual workflow
3+
name: Generate Changelog
44

55
# Controls when the action will run. Workflow runs when manually triggered using the UI
66
# or API.
77
on: workflow_dispatch
88

99
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10-
jobs:
10+
jobs:
1111
generate:
1212
name: Generate Changelog
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v2
17-
17+
1818
- name: Unshallow
1919
run: git fetch --prune --unshallow
20-
21-
# - name: Find Last Tag
22-
# id: last
23-
# uses: jimschubert/query-tag-action@v1
24-
# with:
25-
# include: 'v*'
26-
# exclude: '*-rc*'
27-
# commit-ish: 'HEAD~'
28-
# skip-unshallow: 'true'
20+
2921
- name: Find Current Tag
3022
id: current
3123
uses: jimschubert/query-tag-action@v1
@@ -34,7 +26,7 @@ jobs:
3426
exclude: '*-rc*'
3527
commit-ish: '@'
3628
skip-unshallow: 'true'
37-
29+
3830
- name: Previous Tag
3931
id: last
4032
uses: jimschubert/query-tag-action@v1
@@ -51,11 +43,11 @@ jobs:
5143
FROM: ${{steps.last.outputs.tag}}
5244
TO: ${{steps.current.outputs.tag}}
5345
OUTPUT: .github/CHANGELOG.md
54-
46+
5547
- name: Read CHANGELOG file
5648
id: getchangelog
5749
run: echo "::set-output name=changelog::$(cat .github/CHANGELOG.md)"
58-
50+
5951
- name: View Changelog
6052
run: cat .github/CHANGELOG.md
6153

.github/workflows/test-build.yml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,61 @@
11
# This workflow will build a Java project with Gradle
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
33

4-
name: Test Build
4+
name: Test Build and Changelog
55

66
on:
77
workflow_dispatch:
88

99
jobs:
10+
generate:
11+
name: Generate Changelog (tags)
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Unshallow
18+
run: git fetch --prune --unshallow
19+
20+
- name: Find Current Tag
21+
id: current
22+
uses: jimschubert/query-tag-action@v1
23+
with:
24+
include: 'v*'
25+
exclude: '*-rc*'
26+
commit-ish: '@'
27+
skip-unshallow: 'true'
28+
29+
- name: Previous Tag
30+
id: last
31+
uses: jimschubert/query-tag-action@v1
32+
with:
33+
include: 'v*'
34+
exclude: ${{steps.current.outputs.tag}}
35+
skip-unshallow: 'true'
36+
37+
- name: Generate changelog
38+
uses: jimschubert/beast-changelog-action@v1
39+
with:
40+
GITHUB_TOKEN: ${{github.token}}
41+
CONFIG_LOCATION: .github/changelog.json
42+
FROM: ${{steps.last.outputs.tag}}
43+
TO: ${{steps.current.outputs.tag}}
44+
OUTPUT: .github/CHANGELOG.md
45+
46+
- name: Read CHANGELOG file
47+
id: getchangelog
48+
run: echo "::set-output name=changelog::$(cat .github/CHANGELOG.md)"
49+
50+
- name: View Changelog
51+
run: cat .github/CHANGELOG.md
52+
53+
- name: Add Artifact
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: out
57+
path: .github/CHANGELOG.md
58+
1059
build:
1160
name: Gradle Build
1261
runs-on: ubuntu-latest
@@ -41,3 +90,16 @@ jobs:
4190
with:
4291
name: libs
4392
path: build/libs/*.jar
93+
94+
view:
95+
name: View Changelog Output
96+
runs-on: ubuntu-latest
97+
needs: [generate]
98+
steps:
99+
- name: Download Build Results
100+
uses: actions/download-artifact@v2
101+
with:
102+
name: out
103+
path: out
104+
105+
- run: cat out/CHANGELOG.md

0 commit comments

Comments
 (0)