Skip to content

Commit

Permalink
fix: winget
Browse files Browse the repository at this point in the history
  • Loading branch information
anhoder committed Jul 16, 2023
1 parent 91c449a commit f1bf252
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 32 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
tags:
- v*

env:
REGISTRY: ghcr.io

jobs:
goreleaser:
runs-on: ubuntu-latest
Expand All @@ -24,7 +27,7 @@ jobs:
- name: Setup go...
uses: actions/setup-go@v3
with:
go-version: '^1.20.1'
go-version: '^1.20.6'

- name: branch name
id: branch_name
Expand Down
44 changes: 17 additions & 27 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ builds:
- id: go-musicfox-linux-amd64
main: ./cmd/musicfox.go
binary: musicfox
hooks:
pre:
- apt update && apt install -y libtool gettext libtool-bin
- ./hack/init_linux_env.sh
env:
- BUILD_HOST=x86_64-linux-gnu
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
- CFLAGS=-I/usr/x86_64-linux-gnu/include:$CFLAGS
Expand All @@ -27,16 +22,11 @@ builds:
- id: go-musicfox-linux-arm64
main: ./cmd/musicfox.go
binary: musicfox
hooks:
pre:
- apt update && apt install -y libtool gettext libtool-bin
- ./hack/init_linux_env.sh
goarch:
- arm64
goos:
- linux
env:
- BUILD_HOST=aarch64-linux-gnu
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- CFLAGS=-I/usr/aarch64-linux-gnu/include:$CFLAGS
Expand All @@ -48,16 +38,11 @@ builds:
- id: go-musicfox-linux-arm
main: ./cmd/musicfox.go
binary: musicfox
hooks:
pre:
- apt update && apt install -y libtool gettext libtool-bin
- ./hack/init_linux_env.sh
goarch:
- arm
goos:
- linux
env:
- BUILD_HOST=arm-linux-gnueabi
- CC=arm-linux-gnueabi-gcc
- CXX=arm-linux-gnueabi-g++
- CFLAGS=-I/usr/arm-linux-gnueabi/include:$CFLAGS
Expand All @@ -69,9 +54,6 @@ builds:
- id: go-musicfox-windows-amd64
main: ./cmd/musicfox.go
binary: musicfox
hooks:
pre:
- ./hack/init_windows_env.sh
goarch:
- amd64
goos:
Expand All @@ -81,12 +63,12 @@ builds:
env:
- CC=/usr/local/mingw/bin/x86_64-w64-mingw32-gcc
- CXX=/usr/local/mingw/bin/x86_64-w64-mingw32-g++
- CFLAGS=-I/usr/local/mingw/x86_64-w64-mingw32/include:$CFLAGS
- CPPFLAGS=-I/usr/local/mingw/x86_64-w64-mingw32/include:$CPPFLAGS
- LDFLAGS=-L/usr/local/mingw/x86_64-w64-mingw32/lib:$LDFLAGS
- id: go-musicfox-windows-arm64
main: ./cmd/musicfox.go
binary: musicfox
hooks:
pre:
- ./hack/init_windows_env.sh
goarch:
- arm64
goos:
Expand All @@ -96,6 +78,9 @@ builds:
env:
- CC=/usr/local/mingw/bin/aarch64-w64-mingw32-gcc
- CXX=/usr/local/mingw/bin/aarch64-w64-mingw32-g++
- CFLAGS=-I/usr/local/mingw/aarch64-w64-mingw32/include:$CFLAGS
- CPPFLAGS=-I/usr/local/mingw/aarch64-w64-mingw32/include:$CPPFLAGS
- LDFLAGS=-L/usr/local/mingw/aarch64-w64-mingw32/lib:$LDFLAGS
- id: go-musicfox-darwin-arm64
main: ./cmd/musicfox.go
binary: musicfox
Expand Down Expand Up @@ -138,7 +123,7 @@ archives:

brews:
- name: "{{ .Env.HOMEBREW_NAME }}"
tap:
repository:
owner: go-musicfox
name: homebrew-go-musicfox
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
Expand Down Expand Up @@ -171,10 +156,7 @@ winget:
commit_msg_template: "{{ .PackageIdentifier }}: {{ .Tag }}"
homepage: "https://github.com/go-musicfox/go-musicfox"
description: "A netease music player in terminal."
license_url: "https://goreleaser.com/license"
copyright: "Becker Software LTDA"
copyright_url: "https://goreleaser.com/copyright"
skip_upload: true
skip_upload: auto
release_notes: "{{.Changelog}}"
tags:
- golang
Expand All @@ -183,7 +165,14 @@ winget:
- musicfox
repository:
owner: go-musicfox
name: go-musicfox
name: winget-pkgs
branch: "{{.ProjectName}}-{{.Version}}"
pull_request:
enabled: true
base:
owner: microsoft
name: my-repo
branch: master

# goreleaser支持的配置不多,暂时不用
#scoop:
Expand All @@ -208,6 +197,7 @@ release:
github:
owner: go-musicfox
name: go-musicfox
discussion_category_name: General
prerelease: auto
mode: replace
draft: false
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
PACKAGE_NAME := go-musicfox
GOLANG_CROSS_VERSION ?= v1.19.0
GOLANG_CROSS_VERSION ?= v1.20.6
INJECT_PACKAGE ?= github.com/go-musicfox/go-musicfox/pkg/constants
LDFLAGS := -s -w
LASTFM_KEY ?=
LASTFM_SECRET ?=
REGISTRY ?=
GORELEASER_IMAGE ?= alanalbert/goreleaser-musicfox:$(GOLANG_CROSS_VERSION)

SYSROOT_DIR ?= sysroots
SYSROOT_ARCHIVE ?= sysroots.tar.bz2

ifneq ($(REGISTRY),)
GORELEASER_IMAGE := $(REGISTRY)/go-musicfox/goreleaser-musicfox:$(GOLANG_CROSS_VERSION)
endif

.PHONY: build
build:
./hack/build.sh build
Expand Down Expand Up @@ -39,7 +45,7 @@ release-dry-run:
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-v `pwd`/sysroot:/sysroot \
-w /go/src/$(PACKAGE_NAME) \
alanalbert/goreleaser-cross:${GOLANG_CROSS_VERSION} \
$(GORELEASER_IMAGE) \
--rm-dist --skip-validate --skip-publish

.PHONY: release
Expand All @@ -57,7 +63,7 @@ release:
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-v `pwd`/sysroot:/sysroot \
-w /go/src/$(PACKAGE_NAME) \
alanalbert/goreleaser-cross:${GOLANG_CROSS_VERSION} \
$(GORELEASER_IMAGE) \
release --rm-dist

.PHONY: release-debug-shell
Expand All @@ -73,4 +79,4 @@ release-debug-shell:
-w /go/src/$(PACKAGE_NAME) \
-w /go/src/go-musicfox \
--entrypoint="/bin/bash" \
alanalbert/goreleaser-cross:${GOLANG_CROSS_VERSION}
$(GORELEASER_IMAGE)

0 comments on commit f1bf252

Please sign in to comment.