-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 2.06 KB
/
bump-version.yml
File metadata and controls
63 lines (59 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Bump Version
on:
workflow_call:
inputs:
versionFile:
type: string
description: The path in the repo to the file that tracks the version-file
required: true
outputs:
skipped:
description: If a new release was skipped because there was no changes
value: ${{ jobs.bumpVersion.outputs.skipped }}
version:
description: The new version
value: ${{ jobs.bumpVersion.outputs.version }}
tag:
description: The new tag
value: ${{ jobs.bumpVersion.outputs.tag }}
cleanChangelog:
description: The markdown changelog
value: ${{ jobs.bumpVersion.outputs.cleanChangelog }}
commitHash:
description: The commit hash for the version bump commit
value: ${{ jobs.bumpVersion.outputs.commitHash }}
jobs:
bumpVersion:
name: Bump Version
runs-on: ubuntu-20.04
outputs:
skipped: ${{ steps.changelog.outputs.skipped }}
version: ${{ steps.changelog.outputs.version }}
tag: ${{ steps.changelog.outputs.tag }}
cleanChangelog: ${{ steps.changelog.outputs.clean_changelog }}
commitHash: ${{ steps.commitHash.outputs.commitHash }}
steps:
- name: Checkout Repo
uses: actions/checkout@v1
with:
ref: main
fetch-depth: 0
- name: Create Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
version-file: ${{ inputs.versionFile }}
output-file: "false"
- name: Get Commit Hash
id: commitHash
run: echo "::set-output name=commitHash::$(git rev-parse --verify HEAD)"
- name: Create Release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped != 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}