Skip to content

Commit 208faa9

Browse files
authored
Merge pull request #1 from arran4/add-github-workflows-10130644909224346000
Add GitHub Workflows for PNG Generation and GoReleaser
2 parents 72da25b + 4efb9bd commit 208faa9

3 files changed

Lines changed: 100 additions & 0 deletions

File tree

.github/workflows/generate-png.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Generate PNG
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**.go'
9+
10+
jobs:
11+
generate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v4
19+
with:
20+
go-version-file: 'go.mod'
21+
22+
- name: Install dependencies
23+
run: go get .
24+
25+
- name: Generate PNG
26+
run: go run main.go
27+
28+
- name: Commit and push changes
29+
uses: stefanzweifel/git-auto-commit-action@v4
30+
with:
31+
commit_message: "docs: Regenerate PNG"
32+
file_pattern: vim-barcodes-a4.png

.github/workflows/goreleaser.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: GoReleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v4
19+
with:
20+
go-version-file: 'go.mod'
21+
22+
- name: Run GoReleaser
23+
uses: goreleaser/goreleaser-action@v4
24+
with:
25+
version: latest
26+
args: release --clean
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# .goreleaser.yml
2+
before:
3+
hooks:
4+
- go mod tidy
5+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
- windows
11+
- darwin
12+
archives:
13+
- replacements:
14+
darwin: Darwin
15+
linux: Linux
16+
windows: Windows
17+
386: i386
18+
amd64: x86_64
19+
checksum:
20+
name_template: 'checksums.txt'
21+
snapshot:
22+
name_template: "{{ incpatch .Version }}-next"
23+
changelog:
24+
sort: asc
25+
filters:
26+
exclude:
27+
- '^docs:'
28+
- '^test:'
29+
nfpms:
30+
-
31+
id: "vim-barcode-sheet"
32+
package_name: "vim-barcode-sheet"
33+
homepage: "https://github.com/arran4/vim-barcode-sheet"
34+
maintainer: "Arran Ubels <[email protected]>"
35+
description: "Vim barcode sheet generator."
36+
license: "MIT"
37+
formats:
38+
- "deb"
39+
- "rpm"
40+
bindir: "/usr/bin"

0 commit comments

Comments
 (0)