Skip to content

Commit

Permalink
ci updates
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz "WanzenBug" Wanzenböck <[email protected]>
  • Loading branch information
WanzenBug committed Oct 12, 2023
1 parent 40f9dd1 commit 19e1738
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 27 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
reviewers:
- WanzenBug
schedule:
interval: "weekly"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
reviewers:
- WanzenBug
groups:
ci:
patterns:
- "*" # Include all github-actions update in one PR
37 changes: 17 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
name: release
on:
release:
types: [created]

push:
tags:
- "v*.*.*"
jobs:
release:
name: release linux/amd64
goreleaser:
runs-on: ubuntu-latest
strategy:
matrix:
goarch: [amd64, s390x, arm64]
goos: [linux, darwin]
exclude:
- goos: darwin
goarch: s390x
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
extra_files: LICENSE README.md
sha256sum: TRUE
overwrite: TRUE
go-version: '1.20'
- name: GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update new version in krew-index
uses: rajatjindal/[email protected]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,5 @@ modules.xml

# End of https://www.toptal.com/developers/gitignore/api/intellij+all,go
/kubectl-linstor

dist/
43 changes: 43 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
- s390x

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
21 changes: 16 additions & 5 deletions .krew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor-{{ .TagName }}-darwin-amd64.tar.gz" .TagName }}
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor_{{ .TagName }}_darwin_x86_64.tar.gz" .TagName }}
files:
- from: ./kubectl-linstor
to: .
Expand All @@ -21,7 +21,7 @@ spec:
matchLabels:
os: darwin
arch: arm64
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor-{{ .TagName }}-darwin-arm64.tar.gz" .TagName }}
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
files:
- from: ./kubectl-linstor
to: .
Expand All @@ -32,7 +32,7 @@ spec:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor-{{ .TagName }}-linux-amd64.tar.gz" .TagName }}
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor_{{ .TagName }}_linux_x86_64.tar.gz" .TagName }}
files:
- from: ./kubectl-linstor
to: .
Expand All @@ -43,7 +43,7 @@ spec:
matchLabels:
os: linux
arch: arm64
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor-{{ .TagName }}-linux-arm64.tar.gz" .TagName }}
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
files:
- from: ./kubectl-linstor
to: .
Expand All @@ -54,7 +54,18 @@ spec:
matchLabels:
os: linux
arch: s390x
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor-{{ .TagName }}-linux-s390x.tar.gz" .TagName }}
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor_{{ .TagName }}_linux_s390x.tar.gz" .TagName }}
files:
- from: ./kubectl-linstor
to: .
- from: ./LICENSE
to: .
bin: kubectl-linstor
- selector:
matchLabels:
os: windows
arch: amd64
{{addURIAndSha "https://github.com/piraeusdatastore/kubectl-linstor/releases/download/{{ .TagName }}/kubectl-linstor_{{ .TagName }}_windows_x86_64.tar.gz" .TagName }}
files:
- from: ./kubectl-linstor
to: .
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
github.com/henvic/ctxsignal v1.0.0 h1:EvBKhGucE28G25BSRzJgXtfNQDVk0i5Ag8L/jmfT/hA=
github.com/henvic/ctxsignal v1.0.0/go.mod h1:UT/zf10ZRehwLPo6UhRgzkGEoOEKSfjqhhf1lrV54To=

0 comments on commit 19e1738

Please sign in to comment.