From 605f3b223e78276fea201be9327dc12c5efc66fc Mon Sep 17 00:00:00 2001 From: lihan Date: Sun, 17 Dec 2023 19:39:37 +0800 Subject: [PATCH] support to upload to gemfury --- .github/workflows/go-releaser.yml | 16 ++++++++++---- .goreleaser.yaml | 36 ++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/go-releaser.yml b/.github/workflows/go-releaser.yml index 5b19a83a..f339d418 100644 --- a/.github/workflows/go-releaser.yml +++ b/.github/workflows/go-releaser.yml @@ -2,7 +2,7 @@ name: goreleaser on: push: - tags: ['v*'] + tags: [ 'v*' ] permissions: contents: write @@ -33,6 +33,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN}} + - name: Publish rpm to Gemfury + env: + FURY_TOKEN: ${{ secrets.FURY_TOKEN }} + run: | + for filename in dist/version-fox*.rpm; do + curl -F package=@"$filename" https://{$FURY_TOKEN}@push.fury.io/versionfox/ + done + compile-inno-setup: name: Compile setup and publish needs: release @@ -60,9 +68,9 @@ jobs: VFOX_VERSION: ${{ steps.version-fox-version.outputs.result }} DOWNLOAD_URL: https://github.com/${{ github.event.repository.full_name }}/releases/download run: | - curl -L -o i386.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/version-fox_Windows_i386.zip && unzip i386.zip - curl -L -o x86_64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/version-fox_Windows_x86_64.zip && unzip x86_64.zip - curl -L -o aarch64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/version-fox_Windows_arm64.zip && unzip aarch64.zip + curl -L -o i386.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_i386.zip && unzip i386.zip + curl -L -o x86_64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_x86_64.zip && unzip x86_64.zip + curl -L -o aarch64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_aarch64.zip && unzip aarch64.zip - name: Compile by Inno Setup env: TRZSZ_VERSION: ${{ steps.version-fox-version.outputs.result }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 53b05669..7e5c66b5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,4 +1,5 @@ # .goreleaser.yaml +project_name: vfox before: hooks: - go mod tidy @@ -16,7 +17,6 @@ builds: - amd64 - arm - arm64 - - ppc64 goarm: - "7" ignore: @@ -67,12 +67,16 @@ changelog: archives: - name_template: >- - {{- .ProjectName }}_ - {{- title .Os }}_ + {{ .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}macos_ + {{- else }}{{ .Os }}_{{ end }} {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 + {{- else if eq .Arch "arm64" }}aarch64 + {{- else if eq .Arch "arm" }}armv{{ .Arm }} {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end -}} + wrap_in_directory: true format_overrides: - goos: windows format: zip @@ -98,15 +102,24 @@ brews: commit_author: name: lihan email: aooohan@gmail.com -# dependencies: -# - name: go -# type: optional -# - name: git + # dependencies: + # - name: go + # type: optional + # - name: git test: | system "#{bin}/vfox version" nfpms: - - file_name_template: "{{ .ConventionalFileName }}" + - file_name_template: >- + {{ .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}macos_ + {{- else }}{{ .Os }}_{{ end }} + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else if eq .Arch "arm64" }}aarch64 + {{- else if eq .Arch "arm" }}armv{{ .Arm }} + {{- else }}{{ .Arch }}{{ end }} id: vfox homepage: https://github.com/aooohan/version-fox description: |- @@ -125,10 +138,9 @@ nfpms: file_info: mode: 0644 formats: - - apk - - deb - rpm - - archlinux + rpm: + group: Development/Tools #winget: # - name: vfox