mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
32-bit binaries are no longer supported. Update CI/CD-related files (#2524)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@ -21,8 +21,6 @@ jobs:
|
|||||||
key: linux-go-${{ hashFiles('go.sum') }}-${{ env.cache-key }}
|
key: linux-go-${{ hashFiles('go.sum') }}-${{ env.cache-key }}
|
||||||
restore-keys: linux-go-${{ hashFiles('go.sum') }}-${{ env.cache-key }}
|
restore-keys: linux-go-${{ hashFiles('go.sum') }}-${{ env.cache-key }}
|
||||||
path: ${{ env.go-mod-path }}
|
path: ${{ env.go-mod-path }}
|
||||||
- name: Install goreleaser
|
|
||||||
run: go install github.com/goreleaser/goreleaser@latest
|
|
||||||
- run: mkdir -p "$TEST_RESULTS"
|
- run: mkdir -p "$TEST_RESULTS"
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
@ -44,15 +42,26 @@ jobs:
|
|||||||
echo "TAG_NAME=$(git config --global --add safe.directory /__w/dnscontrol/dnscontrol ; git describe)" >> $GITHUB_OUTPUT
|
echo "TAG_NAME=$(git config --global --add safe.directory /__w/dnscontrol/dnscontrol ; git describe)" >> $GITHUB_OUTPUT
|
||||||
- name: Reveal version
|
- name: Reveal version
|
||||||
run: echo ${{ steps.version.outputs.TAG_NAME }}
|
run: echo ${{ steps.version.outputs.TAG_NAME }}
|
||||||
|
-
|
||||||
- name: Build binaries (if tagged)
|
id: build_binaries_tagged
|
||||||
|
name: Build binaries (if tagged)
|
||||||
if: github.ref_type == 'tag'
|
if: github.ref_type == 'tag'
|
||||||
run: goreleaser build
|
uses: goreleaser/goreleaser-action@v4
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: build
|
||||||
env:
|
env:
|
||||||
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||||
- name: Build binaries (not tagged)
|
-
|
||||||
|
id: build_binaries_not_tagged
|
||||||
|
name: Build binaries (not tagged)
|
||||||
if: github.ref_type != 'tag'
|
if: github.ref_type != 'tag'
|
||||||
run: goreleaser build --snapshot
|
uses: goreleaser/goreleaser-action@v4
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: build --snapshot
|
||||||
env:
|
env:
|
||||||
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||||
integration-test-providers:
|
integration-test-providers:
|
||||||
|
20
.github/workflows/draft_release.yml
vendored
20
.github/workflows/draft_release.yml
vendored
@ -15,10 +15,16 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
# Why "fetch-depth: 0"? To generate the release notes, we need the
|
||||||
|
# full git history. A shallow checkout would make release notes going
|
||||||
|
# back one commit.
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@ -38,9 +44,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ^1.20
|
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
|
# For some reason goreleaser isn't correctly setting the version
|
||||||
# string used by "dnscontrol version". Therefore, we're forcing the
|
# string used by "dnscontrol version". Therefore, we're forcing the
|
||||||
# string using the GORELEASER_CURRENT_TAG feature.
|
# string using the GORELEASER_CURRENT_TAG feature.
|
||||||
@ -53,9 +56,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Reveal version
|
- name: Reveal version
|
||||||
run: echo ${{ steps.version.outputs.TAG_NAME }}
|
run: echo ${{ steps.version.outputs.TAG_NAME }}
|
||||||
|
-
|
||||||
- name: Goreleaser release
|
id: release
|
||||||
run: goreleaser release
|
name: Goreleaser release
|
||||||
|
uses: goreleaser/goreleaser-action@v4
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|
||||||
|
@ -9,6 +9,14 @@ builds:
|
|||||||
- windows
|
- windows
|
||||||
- darwin
|
- darwin
|
||||||
- freebsd
|
- freebsd
|
||||||
|
# List of combinations of GOOS + GOARCH + GOARM to ignore.
|
||||||
|
ignore:
|
||||||
|
- goos: linux
|
||||||
|
goarch: "386"
|
||||||
|
- goos: windows
|
||||||
|
goarch: "386"
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: "386"
|
||||||
ldflags:
|
ldflags:
|
||||||
- -linkmode=internal -s -w -X main.Version="{{ .Version }}" -X main.SHA="{{ .FullCommit }}" -X main.BuildTime={{ .Timestamp }}
|
- -linkmode=internal -s -w -X main.Version="{{ .Version }}" -X main.SHA="{{ .FullCommit }}" -X main.BuildTime={{ .Timestamp }}
|
||||||
before:
|
before:
|
||||||
@ -50,7 +58,7 @@ nfpms:
|
|||||||
- id: packages_rpm
|
- id: packages_rpm
|
||||||
file_name_template: >-
|
file_name_template: >-
|
||||||
{{ .ProjectName }}-
|
{{ .ProjectName }}-
|
||||||
{{ .Version }}.
|
{{- .Version }}.
|
||||||
{{- if eq .Arch "386" }}i386
|
{{- if eq .Arch "386" }}i386
|
||||||
{{- else if eq .Arch "amd64" }}x86_64
|
{{- else if eq .Arch "amd64" }}x86_64
|
||||||
{{- else }}{{ .Arch }}{{ end }}
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
@ -63,7 +71,7 @@ nfpms:
|
|||||||
- id: packages_deb
|
- id: packages_deb
|
||||||
file_name_template: >-
|
file_name_template: >-
|
||||||
{{ .ProjectName }}-
|
{{ .ProjectName }}-
|
||||||
{{ .Version }}.
|
{{- .Version }}.
|
||||||
{{- if eq .Arch "386" }}i386
|
{{- if eq .Arch "386" }}i386
|
||||||
{{- else }}{{ .Arch }}{{ end }}
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
homepage: https://docs.dnscontrol.org/
|
homepage: https://docs.dnscontrol.org/
|
||||||
@ -83,28 +91,12 @@ dockers:
|
|||||||
- build
|
- build
|
||||||
build_flag_templates:
|
build_flag_templates:
|
||||||
- "--pull"
|
- "--pull"
|
||||||
- "--label=org.opencontainers.image.created={{ .Date }}"
|
|
||||||
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
|
|
||||||
- "--label=org.opencontainers.image.version={{ .Version }}"
|
|
||||||
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
|
||||||
- "--platform=linux/amd64"
|
- "--platform=linux/amd64"
|
||||||
- image_templates:
|
|
||||||
- &386_image "stackexchange/{{.ProjectName}}:{{ .Version }}-386"
|
|
||||||
- &386_image_ghcr "ghcr.io/stackexchange/{{.ProjectName}}:{{ .Version }}-386"
|
|
||||||
goos: linux
|
|
||||||
goarch: '386'
|
|
||||||
use: buildx
|
|
||||||
ids:
|
|
||||||
- build
|
|
||||||
build_flag_templates:
|
|
||||||
- "--pull"
|
|
||||||
- "--label=org.opencontainers.image.created={{ .Date }}"
|
- "--label=org.opencontainers.image.created={{ .Date }}"
|
||||||
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
|
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
|
||||||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
|
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
|
||||||
- "--label=org.opencontainers.image.version={{ .Version }}"
|
- "--label=org.opencontainers.image.version={{ .Version }}"
|
||||||
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
||||||
- "--platform=linux/i386"
|
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- &arm_image "stackexchange/{{.ProjectName}}:{{ .Version }}-arm64"
|
- &arm_image "stackexchange/{{.ProjectName}}:{{ .Version }}-arm64"
|
||||||
- &arm_image_ghcr "ghcr.io/stackexchange/{{.ProjectName}}:{{ .Version }}-arm64"
|
- &arm_image_ghcr "ghcr.io/stackexchange/{{.ProjectName}}:{{ .Version }}-arm64"
|
||||||
@ -115,34 +107,30 @@ dockers:
|
|||||||
- build
|
- build
|
||||||
build_flag_templates:
|
build_flag_templates:
|
||||||
- "--pull"
|
- "--pull"
|
||||||
|
- "--platform=linux/arm64"
|
||||||
- "--label=org.opencontainers.image.created={{ .Date }}"
|
- "--label=org.opencontainers.image.created={{ .Date }}"
|
||||||
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
|
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
|
||||||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
|
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
|
||||||
- "--label=org.opencontainers.image.version={{ .Version }}"
|
- "--label=org.opencontainers.image.version={{ .Version }}"
|
||||||
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
- "--label=org.opencontainers.image.source={{ .GitURL }}"
|
||||||
- "--platform=linux/arm64"
|
|
||||||
docker_manifests:
|
docker_manifests:
|
||||||
- name_template: "stackexchange/{{.ProjectName}}:{{ .Version }}"
|
- name_template: "stackexchange/{{.ProjectName}}:{{ .Version }}"
|
||||||
image_templates:
|
image_templates:
|
||||||
- *amd_image
|
- *amd_image
|
||||||
- *386_image
|
|
||||||
- *arm_image
|
- *arm_image
|
||||||
- name_template: "ghcr.io/stackexchange/{{.ProjectName}}:{{ .Version }}"
|
- name_template: "ghcr.io/stackexchange/{{.ProjectName}}:{{ .Version }}"
|
||||||
image_templates:
|
image_templates:
|
||||||
- *amd_image_ghcr
|
- *amd_image_ghcr
|
||||||
- *386_image_ghcr
|
|
||||||
- *arm_image_ghcr
|
- *arm_image_ghcr
|
||||||
- name_template: "stackexchange/{{.ProjectName}}:latest"
|
- name_template: "stackexchange/{{.ProjectName}}:latest"
|
||||||
skip_push: auto
|
skip_push: auto
|
||||||
image_templates:
|
image_templates:
|
||||||
- *amd_image
|
- *amd_image
|
||||||
- *386_image
|
|
||||||
- *arm_image
|
- *arm_image
|
||||||
- name_template: "ghcr.io/stackexchange/{{.ProjectName}}:latest"
|
- name_template: "ghcr.io/stackexchange/{{.ProjectName}}:latest"
|
||||||
skip_push: auto
|
skip_push: auto
|
||||||
image_templates:
|
image_templates:
|
||||||
- *amd_image_ghcr
|
- *amd_image_ghcr
|
||||||
- *386_image_ghcr
|
|
||||||
- *arm_image_ghcr
|
- *arm_image_ghcr
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
|
@ -2,13 +2,10 @@
|
|||||||
|
|
||||||
FROM alpine:3.18.3@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a as RUN
|
FROM alpine:3.18.3@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a as RUN
|
||||||
|
|
||||||
|
|
||||||
# Add runtime dependencies
|
# Add runtime dependencies
|
||||||
# - tzdata: Go time required external dependency eg: TRANSIP and possibly others
|
# - tzdata: Go time required external dependency eg: TRANSIP and possibly others
|
||||||
# - ca-certificates: Needed for https to work properly
|
# - ca-certificates: Needed for https to work properly
|
||||||
RUN --mount=type=cache,target=/var/cache/apk apk update
|
RUN apk update && apk add --no-cache tzdata ca-certificates && update-ca-certificates
|
||||||
RUN --mount=type=cache,target=/var/cache/apk apk add --no-cache tzdata ca-certificates
|
|
||||||
RUN --mount=type=cache,target=/var/cache/apk update-ca-certificates
|
|
||||||
|
|
||||||
COPY dnscontrol /usr/local/bin/
|
COPY dnscontrol /usr/local/bin/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user