mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-10 17:38:13 +08:00
BUG: "dnscontrol version" not working (#2356)
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
parent
d7a87f6e2a
commit
3d1cd30a1d
4 changed files with 42 additions and 6 deletions
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
|
@ -10,7 +10,7 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: golang:1.18
|
||||
image: golang:1.20
|
||||
env:
|
||||
TEST_RESULTS: "/tmp/test-results"
|
||||
steps:
|
||||
|
@ -33,12 +33,28 @@ jobs:
|
|||
- uses: actions/upload-artifact@v3.1.2
|
||||
with:
|
||||
path: "/tmp/test-results"
|
||||
|
||||
# For some reason goreleaser isn't correctly setting the version
|
||||
# string used by "dnscontrol version". Therefore, we're forcing the
|
||||
# string using the GORELEASER_CURRENT_TAG feature.
|
||||
# TODO(tlim): Use the native gorelease version mechanism.
|
||||
- name: Retrieve version
|
||||
id: version
|
||||
run: |
|
||||
echo "TAG_NAME=$(git config --global --add safe.directory /__w/dnscontrol/dnscontrol ; git describe)" >> $GITHUB_OUTPUT
|
||||
- name: Reveal version
|
||||
run: echo ${{ steps.version.outputs.TAG_NAME }}
|
||||
|
||||
- name: Build binaries (if tagged)
|
||||
if: github.ref_type == 'tag'
|
||||
run: goreleaser build
|
||||
env:
|
||||
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||
- name: Build binaries (not tagged)
|
||||
if: github.ref_type != 'tag'
|
||||
run: goreleaser build --snapshot
|
||||
env:
|
||||
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||
integration-test-providers:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -70,7 +86,7 @@ jobs:
|
|||
needs: integration-test-providers
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: golang:1.18
|
||||
image: golang:1.20
|
||||
env:
|
||||
TEST_RESULTS: "/tmp/test-results"
|
||||
GOTESTSUM_FORMAT: testname
|
||||
|
@ -171,7 +187,7 @@ jobs:
|
|||
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: golang:1.18
|
||||
image: golang:1.20
|
||||
needs:
|
||||
- integration-test-providers
|
||||
- integrtests-diff1
|
||||
|
|
16
.github/workflows/draft_release.yml
vendored
16
.github/workflows/draft_release.yml
vendored
|
@ -25,12 +25,26 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ^1.15
|
||||
go-version: ^1.20
|
||||
|
||||
- name: Install goreleaser
|
||||
run: go install github.com/goreleaser/goreleaser@latest
|
||||
|
||||
# For some reason goreleaser isn't correctly setting the version
|
||||
# string used by "dnscontrol version". Therefore, we're forcing the
|
||||
# string using the GORELEASER_CURRENT_TAG feature.
|
||||
# TODO(tlim): Use the native gorelease version mechanism.
|
||||
|
||||
- name: Retrieve version
|
||||
id: version
|
||||
run: |
|
||||
echo "TAG_NAME=$(git config --global --add safe.directory /__w/dnscontrol/dnscontrol ; git describe --tags)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Reveal version
|
||||
run: echo ${{ steps.version.outputs.TAG_NAME }}
|
||||
|
||||
- name: Goreleaser release
|
||||
run: goreleaser release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||
|
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ^1.15
|
||||
go-version: ^1.20
|
||||
|
||||
- name: Build binaries
|
||||
run: go run build/build.go
|
||||
|
|
|
@ -22,7 +22,13 @@ const (
|
|||
)
|
||||
|
||||
var commands = []*cli.Command{}
|
||||
var version string
|
||||
|
||||
// These are set by/for goreleaser
|
||||
var (
|
||||
version = "dev"
|
||||
commit = "none"
|
||||
date = "unknown"
|
||||
)
|
||||
|
||||
func cmd(cat string, c *cli.Command) bool {
|
||||
c.Category = cat
|
||||
|
|
Loading…
Reference in a new issue