mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
BUG: "dnscontrol version" not working (#2356)
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.18
|
image: golang:1.20
|
||||||
env:
|
env:
|
||||||
TEST_RESULTS: "/tmp/test-results"
|
TEST_RESULTS: "/tmp/test-results"
|
||||||
steps:
|
steps:
|
||||||
@ -33,12 +33,28 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v3.1.2
|
- uses: actions/upload-artifact@v3.1.2
|
||||||
with:
|
with:
|
||||||
path: "/tmp/test-results"
|
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)
|
- name: Build binaries (if tagged)
|
||||||
if: github.ref_type == 'tag'
|
if: github.ref_type == 'tag'
|
||||||
run: goreleaser build
|
run: goreleaser build
|
||||||
|
env:
|
||||||
|
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||||
- name: Build binaries (not tagged)
|
- name: Build binaries (not tagged)
|
||||||
if: github.ref_type != 'tag'
|
if: github.ref_type != 'tag'
|
||||||
run: goreleaser build --snapshot
|
run: goreleaser build --snapshot
|
||||||
|
env:
|
||||||
|
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||||
integration-test-providers:
|
integration-test-providers:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -70,7 +86,7 @@ jobs:
|
|||||||
needs: integration-test-providers
|
needs: integration-test-providers
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.18
|
image: golang:1.20
|
||||||
env:
|
env:
|
||||||
TEST_RESULTS: "/tmp/test-results"
|
TEST_RESULTS: "/tmp/test-results"
|
||||||
GOTESTSUM_FORMAT: testname
|
GOTESTSUM_FORMAT: testname
|
||||||
@ -171,7 +187,7 @@ jobs:
|
|||||||
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.18
|
image: golang:1.20
|
||||||
needs:
|
needs:
|
||||||
- integration-test-providers
|
- integration-test-providers
|
||||||
- integrtests-diff1
|
- 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
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: ^1.15
|
go-version: ^1.20
|
||||||
|
|
||||||
- name: Install goreleaser
|
- name: Install goreleaser
|
||||||
run: go install github.com/goreleaser/goreleaser@latest
|
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
|
- name: Goreleaser release
|
||||||
run: goreleaser release
|
run: goreleaser release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: ^1.15
|
go-version: ^1.20
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: go run build/build.go
|
run: go run build/build.go
|
||||||
|
@ -22,7 +22,13 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var commands = []*cli.Command{}
|
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 {
|
func cmd(cat string, c *cli.Command) bool {
|
||||||
c.Category = cat
|
c.Category = cat
|
||||||
|
Reference in New Issue
Block a user