Skip to content

Commit

Permalink
Update 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 a64c6a7 commit c15959f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

github:
- jtprogru
- t0pep0
3 changes: 3 additions & 0 deletions .github/RELEASE-TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Announcements

* First announcement
51 changes: 38 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
name: build

on:
push:
tags:
- 'v*'
branches: [main]
pull_request:
branches: [main]

name: Build

defaults:
run:
shell: bash

jobs:
autorelease:
name: Create Release
lint:
name: Lint files
runs-on: 'ubuntu-latest'
needs:
- golangci
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v2
with:
go-version: '1.16.4'
- name: golangci-lint
uses: golangci/[email protected]
with:
version: latest

build:
name: Build binary
runs-on: 'ubuntu-latest'
needs: lint
strategy:
matrix:
goosarch:
- 'darwin/amd64'
- 'darwin/arm64'
- 'linux/386'
- 'linux/amd64'
- 'linux/arm'
- 'linux/arm64'
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/[email protected]
- uses: actions/setup-go@v2
with:
fetch-depth: 0
go-version: '1.17.3'

- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
Expand All @@ -26,13 +53,11 @@ jobs:
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:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/lint.yml

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
name: publish package

on:
release:
types:
- published

name: Update Go Module Index

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

steps:
- name: Checkout repo
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
- name: Ping endpoint
run: curl "https://proxy.golang.org/github.com/jidicula/random-standup/@v/$(git describe HEAD --tags --abbrev=0).info"

0 comments on commit c15959f

Please sign in to comment.