mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-19 18:59:50 +00:00
ci: fix build scripts to handle multi-tags
This commit is contained in:
parent
7430f37b21
commit
dd4c17972f
8
.github/workflows/release-docker.yaml
vendored
8
.github/workflows/release-docker.yaml
vendored
@ -4,10 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- main
|
|
||||||
- release
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
@ -21,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get tag
|
- name: Get tag
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
|
run: echo "TAG=$(git describe --tags --always --match 'v*')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
@ -42,7 +38,7 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
tags: tobyxdd/hysteria:latest,tobyxdd/hysteria:${{ steps.get_tag.outputs.tag }}
|
tags: tobyxdd/hysteria:latest,tobyxdd/hysteria:${{ steps.get_tag.outputs.TAG }}
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -4,10 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- main
|
|
||||||
- release
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ tasks:
|
|||||||
label: build-{{.TASK}}
|
label: build-{{.TASK}}
|
||||||
vars:
|
vars:
|
||||||
BUILD_VERSION:
|
BUILD_VERSION:
|
||||||
sh: git describe --tags
|
sh: git describe --tags --always --match 'v*'
|
||||||
BUILD_COMMIT:
|
BUILD_COMMIT:
|
||||||
sh: git rev-parse HEAD
|
sh: git rev-parse HEAD
|
||||||
BUILD_DATE:
|
BUILD_DATE:
|
||||||
|
@ -67,7 +67,7 @@ if ($env:HY_APP_VERSION) {
|
|||||||
$ldflags += " -X 'main.appVersion=$($env:HY_APP_VERSION)'"
|
$ldflags += " -X 'main.appVersion=$($env:HY_APP_VERSION)'"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$ldflags += " -X 'main.appVersion=$(git describe --tags --always)'"
|
$ldflags += " -X 'main.appVersion=$(git describe --tags --always --match "v*")'"
|
||||||
}
|
}
|
||||||
if ($env:HY_APP_COMMIT) {
|
if ($env:HY_APP_COMMIT) {
|
||||||
$ldflags += " -X 'main.appCommit=$($env:HY_APP_COMMIT)'"
|
$ldflags += " -X 'main.appCommit=$($env:HY_APP_COMMIT)'"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user