-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
93 lines (93 loc) · 3.59 KB
/
action.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: 'Release That'
description: 'Opinionated GitHub Action to ease the release of a repository'
author: 'Romain Lespinasse'
inputs:
semantic_version:
required: true
# Read https://github.com/cycjimmy/semantic-release-action#semantic_version
default: ''
description: 'Specify specifying version range for semantic-release. If no version range is specified, latest version will be used by default'
dry-run:
description: 'Whether to run semantic release in `dry-run` mode'
default: 'false'
required: true
major-tag:
description: 'Whether to publish or update a major tag (e.g. v1)'
default: 'auto'
required: true
without-prefix:
description: 'Remove prefix from released version'
default: 'false'
required: true
github-token:
description: 'GitHub Token as provided by secrets'
default: ${{ github.token }}
required: true
outputs:
# useful outputs from semantic-release-action
new_release_published:
description: 'Whether a new release was published'
value: ${{ steps.semantic-release.outputs.new_release_published }}
new_release_version:
description: 'Version of the new release'
value: ${{ steps.semantic-release.outputs.new_release_version }}
new_release_major_version:
description: 'Major version of the new release'
value: ${{ steps.semantic-release.outputs.new_release_major_version }}
new_release_minor_version:
description: 'Minor version of the new release'
value: ${{ steps.semantic-release.outputs.new_release_minor_version }}
new_release_patch_version:
description: 'Patch version of the new release'
value: ${{ steps.semantic-release.outputs.new_release_patch_version }}
last_release_version:
description: 'Version of the previous release, if there was one.'
value: ${{ steps.semantic-release.outputs.last_release_version }}
major_tag_published:
description: 'Whether a major tag was published'
value: ${{ steps.major-tag.outputs.major_tag_published }}
major_tag:
description: 'Value of the published major tag, otherwise empty'
value: ${{ steps.major-tag.outputs.major_tag }}
branding:
icon: 'package'
color: 'gray-dark'
runs:
using: 'composite'
steps:
- uses: rlespinasse/github-slug-action@v5
with:
prefix: RT_
- run: $GITHUB_ACTION_PATH/setup.sh
shell: bash
env:
INPUT_DRYRUN: ${{ inputs.dry-run }}
INPUT_WITHOUTPREFIX: ${{ inputs.without-prefix }}
REPOSITORY_NAME: ${{ env.RT_GITHUB_REPOSITORY_NAME_PART }}
REF_POINT: ${{ env.RT_GITHUB_REF_NAME }}
- name: Semantic Release
id: semantic-release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: ${{ inputs.semantic_version }}
dry_run: ${{ inputs.dry-run }}
ci: true
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/git
@semantic-release/github
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- name: Major Tag Publication
id: major-tag
run: $GITHUB_ACTION_PATH/major-tag.sh
shell: bash
env:
INPUT_DRYRUN: ${{ inputs.dry-run }}
INPUT_MAJORTAG: ${{ inputs.major-tag }}
INPUT_WITHOUTPREFIX: ${{ inputs.without-prefix }}
INPUT_GITHUB_TOKEN: ${{ inputs.github-token }}
NEW_RELEASE_PUBLISHED: ${{ steps.semantic-release.outputs.new_release_published }}
NEW_RELEASE_VERSION: ${{ steps.semantic-release.outputs.new_release_version }}
NEW_RELEASE_MAJOR_VERSION: ${{ steps.semantic-release.outputs.new_release_major_version }}