Skip to content

Commit

Permalink
update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed Nov 2, 2024
1 parent 3b4f78b commit 2d1bb48
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 33 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Build assets with Goreleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
version: ~> v2
args: release --clean --snapshot

- name: Upload assets to nightly release
Expand All @@ -89,10 +89,22 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
go-version: 1.23

- name: Use Exiftool
uses: woss/[email protected]
if: matrix.os != 'windows-latest'

- uses: MinoruSekine/[email protected]
with:
apps: exiftool
if: matrix.os == 'windows-latest'

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest

- name: Run tests
run: go test ./... -race
run: go test ./... -json -v -race 2>&1 | gotestfmt -hide 'empty-packages'

publish_stable:
name: Release stable version
Expand Down Expand Up @@ -124,7 +136,7 @@ jobs:
args: release --clean
env:
GORELEASER_GITHUB_TOKEN: ${{ secrets.SCOOP_BUCKET_GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_PUSH_TOKEN }}
FURY_PUSH_TOKEN: ${{ secrets.FURY_PUSH_TOKEN }}
FURY_USERNAME: ${{ secrets.FURY_USERNAME }}

publish_npm:
Expand Down
59 changes: 30 additions & 29 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ archives:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
name_template: checksums.txt
snapshot:
version_template: 'master'
version_template: master
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- ^docs:
- ^test:

nfpms:
- id: main_packages
vendor: '{{ .Env.REPO_OWNER }}'
homepage: '{{ .Env.REPO_WEBSITE }}'
maintainer: '{{ .Env.REPO_MAINTAINER }}'
description: '{{ .Env.REPO_DESCRIPTION }}'
vendor: "{{ .Env.REPO_OWNER }}"
homepage: "{{ .Env.REPO_WEBSITE }}"
maintainer: "{{ .Env.REPO_MAINTAINER }}"
description: "{{ .Env.REPO_DESCRIPTION }}"
license: MIT
formats:
- deb
Expand All @@ -68,10 +68,10 @@ nfpms:
mode: 0644

- id: other_packages
vendor: '{{ .Env.REPO_OWNER }}'
homepage: '{{ .Env.REPO_WEBSITE }}'
maintainer: '{{ .Env.REPO_MAINTAINER }}'
description: '{{ .Env.REPO_DESCRIPTION }}'
vendor: "{{ .Env.REPO_OWNER }}"
homepage: "{{ .Env.REPO_WEBSITE }}"
maintainer: "{{ .Env.REPO_MAINTAINER }}"
description: "{{ .Env.REPO_DESCRIPTION }}"
license: MIT
formats:
- apk
Expand All @@ -97,20 +97,21 @@ publishers:
- name: fury.io
ids:
- main_packages
dir: '{{ dir .ArtifactPath }}'
dir: "{{ dir .ArtifactPath }}"
cmd: curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_PUSH_TOKEN }}@push.fury.io/{{ .Env.FURY_USERNAME }}/

winget:
- publisher: '{{ .Env.REPO_OWNER }}'
- publisher: "{{ .Env.REPO_OWNER }}"
license: MIT
copyright: '{{ .Env.REPO_AUTHOR_NAME }}'
homepage: '{{ .Env.REPO_WEBSITE }}'
short_description: '{{ .Env.REPO_DESCRIPTION }}'
package_identifier: "{{ .Env.REPO_OWNER }}.{{ .Env.REPO_BINARY_NAME }}"
copyright: "{{ .Env.REPO_AUTHOR_NAME }}"
homepage: "{{ .Env.REPO_WEBSITE }}"
short_description: "{{ .Env.REPO_DESCRIPTION }}"
repository:
owner: '{{ .Env.REPO_OWNER }}'
token: '{{ .Env.GORELEASER_GITHUB_TOKEN }}'
owner: "{{ .Env.REPO_OWNER }}"
token: "{{ .Env.GORELEASER_GITHUB_TOKEN }}"
name: winget-pkgs
branch: '{{.ProjectName}}-{{.Version}}'
branch: "{{.ProjectName}}-{{.Version}}"
pull_request:
enabled: true
draft: false
Expand All @@ -120,28 +121,28 @@ winget:
branch: master

scoops:
- url_template: 'https://github.com/ayoisaiah/f2/releases/download/{{ .Tag }}/{{ .ArtifactName }}'
- url_template: https://github.com/ayoisaiah/f2/releases/download/{{ .Tag }}/{{ .ArtifactName }}
repository:
owner: '{{ .Env.REPO_OWNER }}'
owner: "{{ .Env.REPO_OWNER }}"
name: scoop-bucket
token: '{{ .Env.GORELEASER_GITHUB_TOKEN }}'
token: "{{ .Env.GORELEASER_GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: [email protected]
homepage: '{{ .Env.REPO_WEBSITE }}'
description: '{{ .Env.REPO_DESCRIPTION }}'
homepage: "{{ .Env.REPO_WEBSITE }}"
description: "{{ .Env.REPO_DESCRIPTION }}"
license: MIT

brews:
- repository:
owner: '{{ .Env.REPO_OWNER }}'
owner: "{{ .Env.REPO_OWNER }}"
name: homebrew-tap
token: '{{ .Env.GORELEASER_GITHUB_TOKEN }}'
token: "{{ .Env.GORELEASER_GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: [email protected]
homepage: '{{ .Env.REPO_WEBSITE }}'
description: '{{ .Env.REPO_DESCRIPTION }}'
homepage: "{{ .Env.REPO_WEBSITE }}"
description: "{{ .Env.REPO_DESCRIPTION }}"
install: |-
bin.install "{{ with .Env.REPO_BINARY_NAME }}{{ . }}{{ else }}{{ .ProjectName }}{{ end }}"
dependencies:
Expand Down

0 comments on commit 2d1bb48

Please sign in to comment.