-
Notifications
You must be signed in to change notification settings - Fork 185
go releaser action #539
go releaser action #539
Changes from all commits
2318c5c
c3c13b9
8a5e5a5
3ac358b
432df8c
c55fb49
3ad866e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: [ v*.*.* ] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- | ||
name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idea: if you track the semver tag in a comment, Dependabot should update both! I really dig it: you get the immutability of pinning a tag, without losing the visibility that the tag provides. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, neat! will add it! thank you! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will be addressed in a separate PR as per: #547 |
||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
check-latest: true | ||
cache: true | ||
|
||
- | ||
name: Release | ||
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 | ||
with: | ||
distribution: goreleaser | ||
version: v1.10.3 | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,15 @@ release: | |
name: kubeaudit | ||
draft: true | ||
name_template: "{{.ProjectName}}-v{{.Version}}" | ||
dockers: | ||
- dockerfile: goreleaser.Dockerfile | ||
goos: linux | ||
goarch: amd64 | ||
goarm: '' | ||
image_templates: | ||
- "ghcr.io/shopify/kubeaudit:latest" | ||
- "ghcr.io/shopify/kubeaudit:{{ .Tag }}" | ||
- "ghcr.io/shopify/kubeaudit:v{{ .Major }}.{{ .Minor }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noice: this pattern is cool! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the pattern that we had before, but were pointing to docker hub registries instead |
||
builds: | ||
- goos: | ||
- linux | ||
|
@@ -17,6 +26,15 @@ builds: | |
binary: kubeaudit | ||
ldflags: | ||
- -s -w -X github.com/Shopify/kubeaudit/cmd.Version={{.Version}} -X github.com/Shopify/kubeaudit/cmd.Commit={{.Commit}} -X github.com/Shopify/kubeaudit/cmd.BuildDate={{.Date}} | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
- ^Merge | ||
|
||
archives: | ||
- format: tar.gz | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{.Arm }}{{ end }}' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: why
contents: write
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I got it from toxiproxy: https://github.com/Shopify/toxiproxy/blob/master/.github/workflows/release.yml#L17
I assumed the release action required write to be able to create a draft release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also it seems it's required? https://github.com/marketplace/actions/create-release#example