Skip to content

Commit dd4c179

Browse files
committed
ci: fix build scripts to handle multi-tags
1 parent 7430f37 commit dd4c179

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

.github/workflows/release-docker.yaml

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
push:
55
tags:
66
- 'v*'
7-
branches:
8-
- master
9-
- main
10-
- release
117

128
jobs:
139
docker:
@@ -21,7 +17,7 @@ jobs:
2117

2218
- name: Get tag
2319
id: get_tag
24-
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
20+
run: echo "TAG=$(git describe --tags --always --match 'v*')" >> $GITHUB_OUTPUT
2521

2622
- name: Set up QEMU
2723
uses: docker/setup-qemu-action@v2
@@ -42,7 +38,7 @@ jobs:
4238
context: .
4339
push: true
4440
platforms: linux/amd64,linux/arm64
45-
tags: tobyxdd/hysteria:latest,tobyxdd/hysteria:${{ steps.get_tag.outputs.tag }}
41+
tags: tobyxdd/hysteria:latest,tobyxdd/hysteria:${{ steps.get_tag.outputs.TAG }}
4642

4743
- name: Image digest
4844
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/release.yml

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
push:
55
tags:
66
- 'v*'
7-
branches:
8-
- master
9-
- main
10-
- release
117

128
jobs:
139

Taskfile.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tasks:
1313
label: build-{{.TASK}}
1414
vars:
1515
BUILD_VERSION:
16-
sh: git describe --tags
16+
sh: git describe --tags --always --match 'v*'
1717
BUILD_COMMIT:
1818
sh: git rev-parse HEAD
1919
BUILD_DATE:

build.ps1

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ function PlatformToEnv($os, $arch) {
99
$env:CGO_ENABLED = 0
1010
$env:GOOS = $os
1111
$env:GOARCH = $arch
12-
12+
1313
switch -Regex ($arch) {
14-
"arm" {
14+
"arm" {
1515
$env:GOARM = "7"
1616
}
17-
"armv5" {
17+
"armv5" {
1818
$env:GOARM = "5"
1919
$env:GOARCH = "arm"
2020
}
21-
"armv6" {
21+
"armv6" {
2222
$env:GOARM = "6"
2323
$env:GOARCH = "arm"
2424
}
25-
"armv7" {
25+
"armv7" {
2626
$env:GOARM = "7"
2727
$env:GOARCH = "arm"
2828
}
@@ -67,7 +67,7 @@ if ($env:HY_APP_VERSION) {
6767
$ldflags += " -X 'main.appVersion=$($env:HY_APP_VERSION)'"
6868
}
6969
else {
70-
$ldflags += " -X 'main.appVersion=$(git describe --tags --always)'"
70+
$ldflags += " -X 'main.appVersion=$(git describe --tags --always --match "v*")'"
7171
}
7272
if ($env:HY_APP_COMMIT) {
7373
$ldflags += " -X 'main.appCommit=$($env:HY_APP_COMMIT)'"

0 commit comments

Comments
 (0)