Intercept Binary Release #147
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: Intercept Binary Release | |
on: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all tags and branches | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: Get latest tag | |
id: get_latest_tag | |
run: | | |
# Try to get tag for the current commit | |
CURRENT_TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "") | |
# If no tag for current commit, get the most recent tag | |
if [ -z "$CURRENT_TAG" ]; then | |
CURRENT_TAG=$(git describe --tags --abbrev=0) | |
fi | |
echo "LATEST_TAG=${CURRENT_TAG}" >> $GITHUB_OUTPUT | |
- name: Fetch Tags | |
run: | | |
git fetch --tags -f | |
git describe --abbrev=0 | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://x.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
- name: Make all release artifacts | |
run: make build-all | |
- name: Upload All artifacts | |
uses: meeDamian/[email protected] | |
with: | |
tag: ${{ steps.get_latest_tag.outputs.LATEST_TAG }} | |
allow_override: "true" | |
draft: "true" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: ${{ steps.get_latest_tag.outputs.LATEST_TAG }} | |
body: > | |
Release ${{ steps.get_latest_tag.outputs.LATEST_TAG }} | |
gzip: "true" | |
files: > | |
release/intercept-darwin-amd64 | |
release/intercept-darwin-amd64.sha256 | |
release/intercept-darwin-arm64 | |
release/intercept-darwin-arm64.sha256 | |
release/intercept-linux-amd64 | |
release/intercept-linux-amd64.sha256 | |
release/intercept-linux-arm-v7 | |
release/intercept-linux-arm-v7.sha256 | |
release/intercept-linux-arm64 | |
release/intercept-linux-arm64.sha256 | |
release/intercept-windows-amd64.exe | |
release/intercept-windows-amd64.exe.sha256 |