Skip to content

Commit 6a63a04

Browse files
committed
actions: goreleaser in GitHub Actions
1 parent 4cf9a3a commit 6a63a04

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/goreleaser.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: goreleaser
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
goreleaser:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Unshallow
15+
run: git fetch --prune --unshallow
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v1
19+
with:
20+
go-version: 1.16.x
21+
22+
- name: Run GoReleaser
23+
uses: goreleaser/goreleaser-action@v1
24+
with:
25+
version: latest
26+
args: release --rm-dist
27+
key: ${{ secrets.YOUR_PRIVATE_KEY }}
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
project_name: netbootd
2+
before:
3+
hooks:
4+
- go mod download
5+
builds:
6+
- binary: netbootd
7+
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
8+
ldflags:
9+
- -s -w -X github.com/DSpeichert/netbootd/cmd.version={{.Version}} -X github.com/DSpeichert/netbootd/cmd.commit={{.ShortCommit}} -X github.com/DSpeichert/netbootd/cmd.date={{.Date}}
10+
goos:
11+
- linux
12+
goarch:
13+
- amd64
14+
15+
archives:
16+
- wrap_in_directory: true
17+
format: tar.gz
18+
19+
# Additional files/globs you want to add to the archive.
20+
# Defaults are any files matching `LICENCE*`, `LICENSE*`,
21+
# `README*` and `CHANGELOG*` (case-insensitive).
22+
files:
23+
- examples/*
24+
- CHANGELOG*
25+
- README*
26+
- LICENSE*
27+
- netbootd.service

0 commit comments

Comments
 (0)