Skip to content

Commit

Permalink
Add build and publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Savin committed Dec 7, 2021
1 parent ec5ce9c commit a64c6a7
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 5 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build

on:
push:
tags:
- 'v*'

jobs:
autorelease:
name: Create Release
runs-on: 'ubuntu-latest'
needs:
- golangci

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
BINARY_NAME=${{github.repository}}-$GOOS-$GOARCH
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "GOOS=$GOOS" >> $GITHUB_ENV
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: Build
run: |
go build -o "$BINARY_NAME" -v
- name: Release Notes
run: git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an <%ae>' --no-merges >> ".github/RELEASE-TEMPLATE.md"

- name: Release with Notes
uses: softprops/action-gh-release@v1
with:
body_path: ".github/RELEASE-TEMPLATE.md"
draft: true
files: ${{env.BINARY_NAME}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: golangci-lint
on:

'on':
pull_request:
branches:
- main
push:

jobs:
golangci:
name: lint
Expand All @@ -15,4 +17,4 @@ jobs:
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.38
args: -c .golangci.yml
args: -c .golangci.yml
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: publish package

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
needs:
- autorelease

steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Ping endpoint
run: curl "https://proxy.golang.org/github.com/jidicula/random-standup/@v/$(git describe HEAD --tags --abbrev=0).info"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# go-monkill

[![Go Reference](https://pkg.go.dev/badge/github.com/jtprogru/go-monkill.svg)](https://pkg.go.dev/github.com/jtprogru/go-monkill)
[![Linting](https://github.com/jtprogru/go-monkill/actions/workflows/lint.yml/badge.svg)](https://github.com/jtprogru/go-monkill/actions/workflows/lint.yml)
[![golangci-lint](https://github.com/jtprogru/go-monkill/actions/workflows/lint.yml/badge.svg)](https://github.com/jtprogru/go-monkill/actions/workflows/lint.yml)
[![build](https://github.com/jtprogru/go-monkill/actions/workflows/build.yml/badge.svg)](https://github.com/jtprogru/go-monkill/actions/workflows/build.yml)
[![publish](https://github.com/jtprogru/go-monkill/actions/workflows/publish.yml/badge.svg)](https://github.com/jtprogru/go-monkill/actions/workflows/publish.yml)
[![GitHub stars](https://img.shields.io/github/stars/jtprogru/go-monkill.svg)](https://github.com/jtprogru/go-monkill/stargazers)
[![GitHub issues](https://img.shields.io/github/issues-raw/jtprogru/go-monkill)](https://github.com/jtprogru/go-monkill/issues)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/jtprogru/go-monkill)](https://github.com/jtprogru/go-monkill/releases/latest)
![GitHub](https://img.shields.io/github/license/jtprogru/go-monkill)
![Linux](https://img.shields.io/badge/-Linux-grey?logo=linux)
![macOS](https://img.shields.io/badge/-macOS-grey?logo=macos)
![Windows](https://img.shields.io/badge/-Windows-grey?logo=Windows)
[![Donate](https://img.shields.io/badge/-Donate-yellow?logo=paypal)](https://paypal.me/jtprogru)

A very simple utility that allows you to run the desired command or script as soon as a certain process with a known PID completes correctly or with an error.
Expand Down

0 comments on commit a64c6a7

Please sign in to comment.