[action] Build deb during goreleaser action, add to checksum and ...

- add go 1.17 to test matrix
- build with go 1.17
This commit is contained in:
max furman 2021-09-07 11:28:16 -07:00
parent 19726aa61f
commit e4739171b4
3 changed files with 32 additions and 7 deletions

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
go: [ '1.15', '1.16' ] go: [ '1.15', '1.16', '1.17' ]
outputs: outputs:
is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }} is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
steps: steps:
@ -99,10 +99,23 @@ jobs:
name: Set up Go name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.16 go-version: 1.17
-
name: APT Install
id: aptInstall
run: sudo apt-get -y install build-essential debhelper fakeroot
-
name: Build Debian package
id: make_debian
run: |
PATH=$PATH:/usr/local/go/bin:/home/admin/go/bin
make debian
# need to restore the git state otherwise goreleaser fails due to dirty state
git restore debian/changelog
git clean -fd
- -
name: Install cosign name: Install cosign
uses: sigstore/cosign-installer@main uses: sigstore/cosign-installer@v1.1.0
with: with:
cosign-release: 'v1.1.0' cosign-release: 'v1.1.0'
- -
@ -133,7 +146,7 @@ jobs:
name: Set up Go name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.16' go-version: '1.17'
- -
name: APT Install name: APT Install
id: aptInstall id: aptInstall
@ -165,10 +178,10 @@ jobs:
name: Setup Go name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.16' go-version: '1.17'
- -
name: Install cosign name: Install cosign
uses: sigstore/cosign-installer@main uses: sigstore/cosign-installer@v1.1.0
with: with:
cosign-release: 'v1.1.0' cosign-release: 'v1.1.0'
- -

View file

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
go: [ '1.15', '1.16' ] go: [ '1.15', '1.16', '1.17' ]
steps: steps:
- -
name: Checkout name: Checkout

View file

@ -1,10 +1,12 @@
# This is an example .goreleaser.yml file with some sane defaults. # This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com # Make sure to check the documentation at http://goreleaser.com
project_name: step-ca project_name: step-ca
before: before:
hooks: hooks:
# You may remove this if you don't use go modules. # You may remove this if you don't use go modules.
- go mod download - go mod download
builds: builds:
- -
id: step-ca id: step-ca
@ -93,6 +95,7 @@ builds:
binary: bin/step-awskms-init binary: bin/step-awskms-init
ldflags: ldflags:
- -w -X main.Version={{.Version}} -X main.BuildTime={{.Date}} - -w -X main.Version={{.Version}} -X main.BuildTime={{.Date}}
archives: archives:
- -
# Can be used to change the archive formats for specific GOOSs. # Can be used to change the archive formats for specific GOOSs.
@ -106,18 +109,25 @@ archives:
files: files:
- README.md - README.md
- LICENSE - LICENSE
source: source:
enabled: true enabled: true
name_template: '{{ .ProjectName }}_{{ .Version }}' name_template: '{{ .ProjectName }}_{{ .Version }}'
checksum: checksum:
name_template: 'checksums.txt' name_template: 'checksums.txt'
extra_files:
- glob: ./.releases/*
signs: signs:
- cmd: cosign - cmd: cosign
stdin: '{{ .Env.COSIGN_PWD }}' stdin: '{{ .Env.COSIGN_PWD }}'
args: ["sign-blob", "-key=/tmp/cosign.key", "-output=${signature}", "${artifact}"] args: ["sign-blob", "-key=/tmp/cosign.key", "-output=${signature}", "${artifact}"]
artifacts: all artifacts: all
snapshot: snapshot:
name_template: "{{ .Tag }}-next" name_template: "{{ .Tag }}-next"
release: release:
# Repo in which the release will be created. # Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted. # Default is extracted from the origin remote URL or empty if its private hosted.
@ -154,6 +164,8 @@ release:
# The filename on the release will be the last part of the path (base). If # The filename on the release will be the last part of the path (base). If
# another file with the same name exists, the latest one found will be used. # another file with the same name exists, the latest one found will be used.
# Defaults to empty. # Defaults to empty.
extra_files:
- glob: ./.releases/*
#extra_files: #extra_files:
# - glob: ./path/to/file.txt # - glob: ./path/to/file.txt
# - glob: ./glob/**/to/**/file/**/* # - glob: ./glob/**/to/**/file/**/*