Skip to content

Commit

Permalink
Fix prerelease config to set version properly
Browse files Browse the repository at this point in the history
  • Loading branch information
airhorns committed May 5, 2024
1 parent 4e39e33 commit 2beb7cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ jobs:
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean -f .goreleaser.prerelease.yml
args: release --clean --snapshot -f .goreleaser.prerelease.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create prerelease
uses: softprops/action-gh-release@v2
with:
prerelease: true
make_latest: false
name: "${{ github.ref }}prerelease-${{ github.sha }}"
files: |
dist/*.tar.gz
dist/checksum*
11 changes: 3 additions & 8 deletions .goreleaser.prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/gadget-inc/dateilager/pkg/version.Version=v{{.Version}}-prerelease
- -s -w -X github.com/gadget-inc/dateilager/pkg/version.Version=v{{.Version}}
goos:
- linux
- darwin
Expand All @@ -18,7 +18,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/gadget-inc/dateilager/pkg/version.Version=v{{.Version}}-prerelease
- -s -w -X github.com/gadget-inc/dateilager/pkg/version.Version=v{{.Version}}
goos:
- linux
- darwin
Expand All @@ -38,13 +38,8 @@ checksum:
- glob: ./dist/migrations.tar.gz

archives:
- name_template: "{{ .ProjectName }}-v{{ .Version }}-PRERELEASE-{{ .Os }}-{{ .Arch }}"
- name_template: "{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"

release:
version:
name_template: "{{ if .Tag }}{{ .Tag }}+{{ end }}pre-{{ .ShortCommit }}"
prerelease: true
draft: true
make_latest: false
extra_files:
- glob: ./dist/migrations.tar.gz

0 comments on commit 2beb7cf

Please sign in to comment.