File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -5,28 +5,35 @@ name: goreleaser
5
5
6
6
on :
7
7
workflow_dispatch :
8
- inputs :
9
- prerelease :
10
- description : If set, publish this as a release candidate / prerelease version.
11
- type : boolean
12
- required : true
13
8
14
9
jobs :
15
10
release :
11
+ permissions :
12
+ contents : read
16
13
runs-on : ubuntu-latest
17
14
steps :
18
15
- name : Checkout
19
16
uses : actions/checkout@v4
20
17
with :
18
+ # Needed otherwise we get a shallow checkout by default.
19
+ # We need more so that goreleaser can find the previous version.
21
20
fetch-depth : 0
22
21
- name : Set up Go
23
22
uses : actions/setup-go@v5
24
23
with :
25
- go-version : 1.20
24
+ go-version : " 1.20"
25
+ - name : Extract version
26
+ id : extract_version
27
+ run : |
28
+ CMD_VERSION="$(go run ./cmd/jsonnet --version | grep -oe 'v[0-9][0-9a-z.-]*$')" &&
29
+ printf "Extracted jsonnet version: %s\n" "${CMD_VERSION}" &&
30
+ git tag "${CMD_VERSION}" &&
31
+ printf "jsonnet_version='%s'\n" "${CMD_VERSION}" >> "${GITHUB_OUTPUT}"
26
32
- name : Run GoReleaser
27
33
uses : goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
34
+ env :
35
+ PROPOSED_VERSION : " ${{ steps.extract_version.outputs.jsonnet_version }}"
36
+ GITHUB_TOKEN : " ${{ github.token }}"
28
37
with :
29
38
version : latest
30
- args : release --rm-dist
31
- env :
32
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
+ args : release --clean --draft
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ checksum:
96
96
release :
97
97
draft : true
98
98
skip_upload : false
99
+ target_commitish : " {{ .Env.PROPOSED_VERSION }}"
99
100
100
101
nfpms :
101
102
- id : jsonnet
You can’t perform that action at this time.
0 commit comments