16
16
description : Create a draft release (for manually editing release notes before publishing).
17
17
type : boolean
18
18
required : true
19
- snapshot :
20
- description : Force a dev version to be generated, implies dry_run.
21
- type : boolean
22
- required : true
19
+ default : false
23
20
dry_run :
24
21
description : Perform a dry-run release.
25
22
type : boolean
26
23
required : true
24
+ default : false
25
+ snapshot :
26
+ description : Force a dev version to be generated, implies dry_run.
27
+ type : boolean
28
+ default : false
27
29
ignore_missing_commit_metadata :
28
30
description : WARNING! This option disables the requirement that all commits have a PR. Not needed for dry_run.
29
31
type : boolean
@@ -38,9 +40,7 @@ permissions:
38
40
id-token : write
39
41
40
42
env :
41
- CODER_RELEASE : ${{ github.event.inputs.snapshot && 'false' || 'true' }}
42
- DRY_RUN : ${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && 'true' || 'false' }}
43
- CODER_IGNORE_MISSING_COMMIT_METADATA : ${{ github.event.inputs.ignore_missing_commit_metadata && '1' || '0' }}
43
+ CODER_RELEASE : ${{ !github.event.inputs.snapshot }}
44
44
45
45
concurrency : ${{ github.workflow }}-${{ github.ref }}
46
46
@@ -76,15 +76,21 @@ jobs:
76
76
ref=HEAD
77
77
old_version="$(git describe --abbrev=0 "$ref^1")"
78
78
79
+ if [[ "${{ github.event.inputs.ignore_missing_commit_metadata }}" == *t* ]]; then
80
+ export CODER_IGNORE_MISSING_COMMIT_METADATA=1
81
+ fi
82
+
79
83
# Warn if CODER_IGNORE_MISSING_COMMIT_METADATA is set any other way
80
84
# than via dry-run.
81
85
if [[ ${CODER_IGNORE_MISSING_COMMIT_METADATA:-0} != 0 ]]; then
82
86
echo "WARNING: CODER_IGNORE_MISSING_COMMIT_METADATA is enabled and we will ignore missing commit metadata." 1>&2
83
87
fi
84
88
85
- if [[ $DRY_RUN == true ]]; then
89
+ version_args=()
90
+ if [[ "${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}" == *t* ]]; then
86
91
# Allow dry-run of branches to pass.
87
92
export CODER_IGNORE_MISSING_COMMIT_METADATA=1
93
+ version_args+=(--dry-run)
88
94
fi
89
95
90
96
# Cache commit metadata.
94
100
# release.sh is run).
95
101
version="$(
96
102
./scripts/release/tag_version.sh \
97
- ${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && '--dry-run' }} \
103
+ "${version_args[@]}" \
98
104
--ref "$ref" \
99
105
--${{ github.event.inputs.increment }}
100
106
)"
@@ -222,9 +228,17 @@ jobs:
222
228
- name : Publish release
223
229
run : |
224
230
set -euo pipefail
231
+
232
+ args=()
233
+ if [[ "${{ github.event.inputs.draft }}" == *t* ]]; then
234
+ args+=(--draft)
235
+ fi
236
+ if [[ "${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}" == *t* ]]; then
237
+ args+=(--dry_run)
238
+ fi
239
+
225
240
./scripts/release/publish.sh \
226
- ${{ github.event.inputs.draft && '--draft' }} \
227
- ${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && '--dry-run' }} \
241
+ "${args[@]}" \
228
242
--release-notes-file "$CODER_RELEASE_NOTES_FILE" \
229
243
./build/*_installer.exe \
230
244
./build/*.zip \
@@ -246,6 +260,7 @@ jobs:
246
260
uses : " google-github-actions/setup-gcloud@v1"
247
261
248
262
- name : Publish Helm Chart
263
+ if : ${{ !github.event.inputs.dry_run && !github.event.inputs.snapshot }}
249
264
run : |
250
265
set -euo pipefail
251
266
version="$(./scripts/version.sh)"
0 commit comments