Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 12e583c

Browse files
committedMay 23, 2024
sync workflow and goreleaser cfg from scaffolding
1 parent de7965f commit 12e583c

File tree

3 files changed

+42
-27
lines changed

3 files changed

+42
-27
lines changed
 

‎.github/workflows/release.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,49 @@ name: release
1313
on:
1414
push:
1515
tags:
16-
- 'v*'
16+
- "v*"
17+
permissions:
18+
contents: write
19+
packages: read
1720
jobs:
21+
get-go-version:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
go-version: ${{ steps.get-go-version.outputs.go-version }}
25+
steps:
26+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
27+
- name: "Determine Go version"
28+
id: get-go-version
29+
run: |
30+
echo "Found Go $(cat .go-version)"
31+
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
1832
goreleaser:
33+
needs:
34+
- get-go-version
1935
runs-on: ubuntu-latest
2036
steps:
2137
- name: Checkout
22-
uses: actions/checkout@v2
38+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2339
- name: Unshallow
2440
run: git fetch --prune --unshallow
2541
- name: Set up Go
26-
uses: actions/setup-go@v2
42+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2743
with:
28-
go-version: 1.22
44+
go-version: ${{ needs.get-go-version.outputs.go-version }}
2945
- name: Describe plugin
3046
id: plugin_describe
31-
run: echo "::set-output name=api_version::$(go run . describe | jq -r '.api_version')"
47+
run: echo "api_version=$(go run . describe | jq -r '.api_version')" >> $GITHUB_OUTPUT
3248
- name: Import GPG key
3349
id: import_gpg
34-
uses: crazy-max/ghaction-import-gpg@v5
50+
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5.2.0
3551
with:
3652
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
3753
passphrase: ${{ secrets.GPG_PASSPHRASE }}
3854
- name: Run GoReleaser
39-
uses: goreleaser/goreleaser-action@v2
55+
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
4056
with:
4157
version: latest
42-
args: release --rm-dist
58+
args: release --clean --timeout 120m
4359
env:
4460
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
4561
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.go-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.22.3

‎.goreleaser.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,27 @@ before:
99
- go test ./...
1010
# As part of the release doc files are included as a separate deliverable for
1111
# consumption by Packer.io. To include a separate docs.zip uncomment the following command.
12-
- make ci-release-docs
12+
#- make ci-release-docs
1313
# Check plugin compatibility with required version of the Packer SDK
1414
- make plugin-check
1515
builds:
1616
# A separated build to run the packer-plugins-check only once for a linux_amd64 binary
17-
-
18-
id: plugin-check
19-
mod_timestamp: '{{ .CommitTimestamp }}'
17+
- id: plugin-check
18+
mod_timestamp: "{{ .CommitTimestamp }}"
2019
flags:
2120
- -trimpath #removes all file system paths from the compiled executable
2221
ldflags:
23-
- '-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
22+
- "-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
2423
goos:
2524
- linux
2625
goarch:
2726
- amd64
28-
binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
29-
-
30-
mod_timestamp: '{{ .CommitTimestamp }}'
27+
binary: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
28+
- mod_timestamp: "{{ .CommitTimestamp }}"
3129
flags:
3230
- -trimpath #removes all file system paths from the compiled executable
3331
ldflags:
34-
- '-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
32+
- "-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
3533
goos:
3634
- netbsd
3735
- solaris
@@ -42,24 +40,24 @@ builds:
4240
- darwin
4341
goarch:
4442
- amd64
45-
- '386'
43+
- "386"
4644
- arm
4745
- arm64
4846
ignore:
4947
- goos: openbsd
5048
goarch: arm64
5149
- goos: darwin
52-
goarch: '386'
50+
goarch: "386"
5351
- goos: linux
5452
goarch: amd64
55-
binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
53+
binary: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
5654
archives:
57-
- format: zip
58-
files:
59-
- none*
60-
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
55+
- format: zip
56+
files:
57+
- none*
58+
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
6159
checksum:
62-
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
60+
name_template: "{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS"
6361
algorithm: sha256
6462
signs:
6563
- artifacts: checksum
@@ -78,8 +76,8 @@ release:
7876
# draft: true
7977
# As part of the release doc files are included as a separate deliverable for consumption by Packer.io.
8078
# To include a separate docs.zip uncomment the extra_files config and the docs.zip command hook above.
81-
extra_files:
82-
- glob: ./docs.zip
79+
#extra_files:
80+
#- glob: ./docs.zip
8381

8482
changelog:
8583
skip: true

0 commit comments

Comments
 (0)
Please sign in to comment.