-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
189 lines (164 loc) · 5.33 KB
/
action.yml
File metadata and controls
189 lines (164 loc) · 5.33 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
---
name: Python Semantic Release Composite Action
description: |
Automated Releases via SemVer and Commit Message Conventions.
Most of this file is copied from PSR official repository:
https://github.com/python-semantic-release/python-semantic-release
branding:
color: orange
inputs:
root_options:
default: "-v"
required: false
description: |
Additional options for the main command. Example: -vv --noop
directory:
default: "."
required: false
description: Sub-directory to cd into before running semantic-release
github_token:
type: string
required: true
description: GitHub token used to push release notes and new commits/tags
git_committer_name:
type: string
required: false
description: The human name for the “committer” field
git_committer_email:
type: string
required: false
description: The email address for the “committer” field
ssh_public_signing_key:
type: string
required: false
description: The ssh public key used to sign commits
ssh_private_signing_key:
type: string
required: false
description: The ssh private key used to sign commits
# `semantic-release version` command line options
prerelease:
type: boolean
required: false
description: |
Force the next version to be a prerelease. Set to "true" or "false".
prerelease_token:
type: string
required: false
description: |
Force the next version to use this prerelease token,
if it is a prerelease.
force:
type: string
required: false
description: |
Force the next version to be a major release. Must be set to
one of "prerelease", "patch", "minor", or "major".
commit:
type: boolean
required: false
description: Whether or not to commit changes locally. Defaults are handled
by python-semantic-release internal version command.
tag:
type: boolean
required: false
description: |
Whether or not to make a local version tag. Defaults are handled
by python-semantic-release internal version command.
push:
type: boolean
required: false
description: |
Whether or not to push local commits to the Git repository. See
the configuration page for defaults of `semantic-release version`
for how the default is determined between push, tag, & commit.
changelog:
type: boolean
required: false
description: |
Whether or not to update the changelog.
vcs_release:
type: boolean
required: false
description: |
Whether or not to create a release in the remote VCS, if supported
build:
type: boolean
required: false
description: |
Whether or not to run the build_command for the project. Defaults are
handled by python-semantic-release internal version command.
build_metadata:
type: string
required: false
description: |
Build metadata to append to the new version
psr_version:
type: string
required: false
description: |
Pin python-semantic-release version to a specific value
outputs:
is_prerelease:
value: ${{ steps.semrel.outputs.is_prerelease }}
description: |
"true" if the version is a prerelease, "false" otherwise
released:
value: ${{ steps.semrel.outputs.released }}
description: |
"true" if a release was made, "false" otherwise
tag:
value: ${{ steps.semrel.outputs.tag }}
description: |
The Git tag corresponding to the version output
version:
value: ${{ steps.semrel.outputs.version }}
description: |
The newly released version if one was made, otherwise the current version
runs:
using: "composite"
steps:
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- name: Prepare PSR environment
shell: bash
env:
INPUT_PSR_VERSION: ${{ inputs.psr_version }}
run: |
set -eux
if ! command -v python $> /dev/null
then
echo "Python not found."
exit 1
fi
python -m venv ~/semantic-release/.venv
source ~/semantic-release/.venv/bin/activate
if [ -z "$INPUT_PSR_VERSION" ]
then
pip install python-semantic-release
else
pip install "python-semantic-release==$INPUT_PSR_VERSION"
fi
- name: PSR action script
id: semrel
shell: bash
env:
INPUT_ROOT_OPTIONS: ${{ inputs.root_options }}
INPUT_DIRECTORY: ${{ inputs.directory }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_GIT_COMMITTER_NAME: ${{ inputs.git_committer_name }}
INPUT_GIT_COMMITTER_EMAIL: ${{ inputs.git_committer_email }}
INPUT_SSH_PUBLIC_SIGNING_KEY: ${{ inputs.ssh_public_signing_key }}
INPUT_SSH_PRIVATE_SIGNING_KEY: ${{ inputs.ssh_private_signing_key }}
INPUT_PRERELEASE: ${{ inputs.prerelease }}
INPUT_PRERELEASE_TOKEN: ${{ inputs.prerelease_token }}
INPUT_FORCE: ${{ inputs.force }}
INPUT_COMMIT: ${{ inputs.commit }}
INPUT_TAG: ${{ inputs.tag }}
INPUT_PUSH: ${{ inputs.push }}
INPUT_CHANGELOG: ${{ inputs.changelog }}
INPUT_VCS_RELEASE: ${{ inputs.vcs_release }}
INPUT_BUILD: ${{ inputs.build }}
INPUT_BUILD_METADATA: ${{ inputs.build_metadata }}
INPUT_PSR_VERSION: ${{ inputs.psr_version }}
run: action.sh