From 38237bc5926d1f25ee568ef63365f4fa80552e6c Mon Sep 17 00:00:00 2001 From: Ayooluwa Isaiah Date: Sat, 2 Nov 2024 22:21:28 +0100 Subject: [PATCH] update release workflow --- .github/workflows/release.yml | 20 +++++++++--- .goreleaser.yml | 59 ++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6af945c..6a46888 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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/exiftool-action@v12.92 + if: matrix.os != 'windows-latest' + + - uses: MinoruSekine/setup-scoop@v4.0.1 + 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 @@ -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: diff --git a/.goreleaser.yml b/.goreleaser.yml index 50be848..9e2d953 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 @@ -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 @@ -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 @@ -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: goreleaser@carlosbecker.com - 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: goreleaser@carlosbecker.com - 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: