mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-16 20:39:08 +08:00
69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
on:
|
|
push:
|
|
tags:
|
|
- v[0-9]+.[0-9]+.[0-9]+
|
|
- v[0-9]+.[0-9]+.[0-9]+-*
|
|
|
|
name: "Release: Make release candidate"
|
|
jobs:
|
|
draft_release:
|
|
name: draft release
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
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
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: ^1.21
|
|
|
|
# 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 }}
|
|
-
|
|
id: release
|
|
name: Goreleaser release
|
|
uses: goreleaser/goreleaser-action@v5
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
|