Skip to content

Merge pull request #57 from mdeous/dependabot/github_actions/gh-actio… #56

Merge pull request #57 from mdeous/dependabot/github_actions/gh-actio…

Merge pull request #57 from mdeous/dependabot/github_actions/gh-actio… #56

Workflow file for this run

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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
submodules: true
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
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/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
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-*