Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add goreleaser and github action
- Loading branch information
kidsan
committed
Nov 9, 2021
1 parent
6cde5e3
commit 4138456
Showing
2 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
name: learn-github-actions | ||
on: [push] | ||
name: release | ||
on: | ||
push: | ||
branches: [master] | ||
jobs: | ||
check-bats-version: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v2 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: go | ||
package-name: german | ||
bump-minor-pre-major: true | ||
|
||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
- run: npm install -g bats | ||
- run: bats -v | ||
fetch-depth: 0 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16' | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Clean working directory | ||
run: git checkout . && git clean -f | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Create binaries, containers and GitHub release | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: ${{ steps.release.outputs.release_created }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This is an example .goreleaser.yml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
before: | ||
hooks: | ||
# You may remove this if you don't use go modules. | ||
- go mod tidy | ||
# you may remove this if you don't need go generate | ||
# - go generate ./... | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
release: | ||
name_template: "{{.ProjectName}}-v{{.Version}}" |