From 532a5bd30ed35edd9e7e0c08b63d8e4621961510 Mon Sep 17 00:00:00 2001 From: kovacs Date: Mon, 9 Oct 2023 15:56:00 +0800 Subject: [PATCH] chore(task): fix bin name, fix github auth fix bin name, fix github auth Signed-off-by: kovacs --- Taskfile.yaml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 4051c78..803bd86 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -8,9 +8,13 @@ vars: BUILD_DATE: sh: date '+%F %T' PREMIUM_VERSION: - sh: curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} https://api.github.com/repos/Dreamacro/clash/releases/tags/premium | jq -r '.name' + sh: | + curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} \ + https://api.github.com/repos/Dreamacro/clash/releases/tags/premium | jq -r '.name' META_VERSION: - sh: curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest | jq -r '.name' + sh: | + curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} \ + https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest | jq -r '.name' tasks: clean: @@ -103,7 +107,10 @@ tasks: desc: Download Clash Premium vars: CLASH_PREMIUM_URL: - sh: curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} https://api.github.com/repos/Dreamacro/clash/releases/tags/premium | jq -r '.assets[].browser_download_url | select (. | test("clash-{{.PLATFORM}}-\\d{4}.*gz"))' + sh: | + curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} \ + https://api.github.com/repos/Dreamacro/clash/releases/tags/premium | \ + jq -r '.assets[].browser_download_url | select (. | test("clash-{{.PLATFORM}}-\\d{4}.*gz"))' cmds: - curl -sSL {{.CLASH_PREMIUM_URL}} > build/clash-{{.PLATFORM}}.gz - gzip -d build/clash-{{.PLATFORM}}.gz @@ -115,7 +122,10 @@ tasks: desc: Download Clash Meta vars: CLASH_META_URL: - sh: curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest | jq -r '.assets[].browser_download_url | select (. | test("clash.meta-{{.PLATFORM}}-v\\d+.*gz"))' + sh: | + curl -sSL {{if .GITHUB_TOKEN}}-H 'Authorization: Bearer {{.GITHUB_TOKEN}}'{{end}} \ + https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest | \ + jq -r '.assets[].browser_download_url | select (. | test("clash.meta-{{.PLATFORM}}-v\\d+.*gz"))' cmds: - curl -sSL {{.CLASH_META_URL}} > build/clash-meta-{{.PLATFORM}}.gz - gzip -d build/clash-meta-{{.PLATFORM}}.gz @@ -159,7 +169,7 @@ tasks: -X 'main.version={{.VERSION}}' \ -X 'main.clash={{.PREMIUM_VERSION}}' \ -X 'main.branch=premium' \ - -X 'main.binName=tpclash-premium-{{.PLATFORM}}'" \ + -X 'main.binName=tpclash-premium-{{.GOOS}}-{{.GOARCH}}{{if .GOAMD64}}-{{.GOAMD64}}{{end}}'" \ {{if .DEBUG}}-gcflags "all=-N -l"{{end}} build-tpclash-meta: @@ -183,7 +193,7 @@ tasks: -X 'main.version={{.VERSION}}' \ -X 'main.clash=Meta {{.META_VERSION}}' \ -X 'main.branch=meta' \ - -X 'main.binName=tpclash-meta-{{.PLATFORM}}'" \ + -X 'main.binName=tpclash-meta-{{.GOOS}}-{{.GOARCH}}{{if .GOAMD64}}-{{.GOAMD64}}{{end}}'" \ {{if .DEBUG}}-gcflags "all=-N -l"{{end}}