Merge pull request #18 from mdeous/dependabot/go_modules/github.com/s… #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.go' | |
- 'go.mod' | |
- 'go.sum' | |
- '.github/workflows/release.yml' | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: true | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.16 | |
- name: Install gox | |
run: go install github.com/mitchellh/gox@latest | |
- name: Build | |
run: make cross-compile | |
- name: Get release version | |
id: get_version | |
run: | | |
version="" | |
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then | |
version="nightly" | |
else | |
version="$(make version)" | |
fi | |
echo "Version: ${version}" | |
echo "version=${version}" >> $GITHUB_OUTPUT | |
- name: Publish release | |
uses: marvinpinto/[email protected] | |
with: | |
automatic_release_tag: ${{ steps.get_version.outputs.version }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: ${{ github.ref == 'refs/heads/main' }} | |
title: ${{ steps.get_version.outputs.version }} | |
files: | | |
build/dnscheck-* |