Skip to content

Commit

Permalink
chore(gh-actions): release with makefile target instead of goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-github committed Jun 15, 2024
1 parent 52d02b4 commit d745683
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 61 deletions.
62 changes: 20 additions & 42 deletions .github/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,31 @@
project_name: xelon-csi

archives:
- files:
- LICENSE
- README.md
format: zip
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
rlcp: true

before:
hooks:
- go mod tidy

builds:
- binary: '{{ .ProjectName }}'
flags:
- -trimpath
goarch:
- amd64
goos:
- linux
ldflags:
- -s -w
- -X github.com/Xelon-AG/xelon-csi/driver.driverVersion={{ .Version }}
- -X github.com/Xelon-AG/xelon-csi/driver.gitCommit={{ .Commit }}
- -X github.com/Xelon-AG/xelon-csi/driver.gitTreeState=clean
- -X github.com/Xelon-AG/xelon-csi/driver.buildDate={{ .Date }}
main: cmd/xelon-csi/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
- skip: true

changelog:
skip: true

checksum:
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
algorithm: sha256

dist: build

dockers:
- dockerfile: Dockerfile
goarch: amd64
goos: linux
image_templates:
- "xelonag/xelon-csi:latest"
- "xelonag/xelon-csi:{{ .Tag }}"

env:
- CGO_ENABLED=0
sort: asc
groups:
- title: "Features"
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: "Others"
order: 999
filters:
exclude:
- "^docs:"
- "^test:"
- "^Merge pull request"
- "^Release"

release:
draft: false
github:
owner: Xelon-AG
name: xelon-csi
10 changes: 2 additions & 8 deletions .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
cache: true

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Release development Docker image
run: make build release-docker-dev
run: make release-docker-dev
18 changes: 7 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
cache: true

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
- name: Release production Docker images
run: make release-docker

- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --config .github/goreleaser.yaml --clean
args: release -f .github/goreleaser.yaml --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d745683

Please sign in to comment.