Skip to content

Commit

Permalink
Merge pull request #4 from swhite24/feature/cli-release-workflow
Browse files Browse the repository at this point in the history
add release workflow
  • Loading branch information
swhite24 authored Apr 16, 2021
2 parents 8e0b30c + 3f1c577 commit 5a292a1
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
pull_request:
types:
- labeled
- closed

jobs:
release-check:
runs-on: ubuntu-latest
if: github.event.action == 'labeled'
steps:
- uses: actions/checkout@v2
# Bump version on merging Pull Requests with specific labels.
# (bump:major,bump:minor,bump:patch)
- uses: haya14busa/action-bumpr@v1
pre-release:
runs-on: ubuntu-latest
if: github.event.action == 'closed' && github.event.pull_request.merged
outputs:
skip: ${{ steps.bumpr.outputs.skip }}
steps:
- uses: actions/checkout@v2
- id: bumpr
uses: haya14busa/action-bumpr@v1
with:
github_token: ${{ secrets.GH_TOKEN }}
release:
runs-on: ubuntu-latest
if: github.event.action == 'closed' && github.event.pull_request.merged
needs: pre-release
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: "!needs.pre-release.outputs.skip"
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
32 changes: 32 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
before:
hooks:
- go mod download
builds:
- dir: cmd/cbpro-buy
binary: "{{ .ProjectName }}_{{ .Tag }}"
flags:
- -trimpath
env:
- CGO_ENABLED=0
goarch:
- "386"
- amd64
- arm
- arm64
goos:
- linux
- windows
- darwin
ignore:
- goarch: "386"
goos: darwin
mod_timestamp: "{{ .CommitTimestamp }}"
checksum:
name_template: "{{ .ProjectName }}_{{ .Tag }}_SHA256SUMS"
algorithm: sha256
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 Scott Chacon and others
Copyright (c) 2021 Steven White

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down

0 comments on commit 5a292a1

Please sign in to comment.