Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 49af2e0

Browse files
authored
Merge pull request #45 from dev-sec/workflows
add changelog and release workflow
2 parents b6d65a5 + 5d885be commit 49af2e0

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

.github/workflows/changelog.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Create Changelog
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
release:
8+
types: [published]
9+
10+
issues:
11+
types: [closed, edited]
12+
13+
jobs:
14+
generate_changelog:
15+
runs-on: ubuntu-latest
16+
name: Generate changelog for master branch
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
- name: Generate changelog
21+
uses: charmixer/auto-changelog-action@v1
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: push
26+
uses: github-actions-x/[email protected]
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
push-branch: 'master'
30+
commit-message: 'update changelog'
31+
force-add: 'true'
32+
files: CHANGELOG.md
33+
name: dev-sec CI
34+

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: New release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
generate_changelog:
10+
runs-on: ubuntu-latest
11+
name: create release draft
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: 'Get Previous tag'
16+
id: previoustag
17+
uses: "WyriHaximus/github-action-get-previous-tag@master"
18+
env:
19+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
20+
21+
- name: calculate next version
22+
id: version
23+
uses: charmixer/auto-changelog-action@8095796
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Generate changelog
28+
uses: charmixer/auto-changelog-action@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
since_tag: ${{ steps.previoustag.outputs.tag }}
32+
future_release: ${{ steps.version.outputs.next-version }}
33+
34+
- name: Read CHANGELOG.md
35+
id: package
36+
uses: juliangruber/read-file-action@v1
37+
with:
38+
path: ./CHANGELOG.md
39+
40+
- name: Create Release draft
41+
id: create_release
42+
uses: actions/create-release@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
45+
with:
46+
release_name: ${{ steps.version.outputs.next-version }}
47+
tag_name: ${{ steps.version.outputs.next-version }}
48+
body: |
49+
${{ steps.package.outputs.content }}
50+
draft: true

0 commit comments

Comments
 (0)