Skip to content

Commit

Permalink
chore(task): fix bin name, fix github auth
Browse files Browse the repository at this point in the history
fix bin name, fix github auth

Signed-off-by: kovacs <mritd@linux.com>
  • Loading branch information
mritd committed Oct 9, 2023
1 parent d472253 commit 532a5bd
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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}}
Expand Down

0 comments on commit 532a5bd

Please sign in to comment.