Skip to content

Commit bc9516b

Browse files
committed
Add a release workflow.
1 parent 45c6007 commit bc9516b

File tree

4 files changed

+96
-2
lines changed

4 files changed

+96
-2
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
# .github/workflows/release.yml
3+
name: release
4+
5+
on:
6+
pull_request:
7+
push:
8+
# run only against tags
9+
tags:
10+
- "*"
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
goreleaser:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: stable
27+
- name: Run GoReleaser
28+
uses: goreleaser/goreleaser-action@v6
29+
with:
30+
distribution: goreleaser
31+
version: "~> v2"
32+
args: release --clean
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v4
13-
- name: Setup Go
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Set up Go
1417
uses: actions/setup-go@v5
1518
with:
1619
go-version: stable

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ulp-forth
22
.vscode/
3+
dist/
34
out.bin
45
out.nonportable.S
56
out.S

.goreleaser.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 2
10+
11+
before:
12+
hooks:
13+
- go mod tidy
14+
# you may remove this if you don't need go generate
15+
- go generate ./...
16+
17+
builds:
18+
- env:
19+
- CGO_ENABLED=0
20+
goos:
21+
- linux
22+
- windows
23+
- darwin
24+
goarch:
25+
- amd64
26+
- arm
27+
- arm64
28+
29+
archives:
30+
- format: tar.gz
31+
# this name template makes the OS and Arch compatible with the results of `uname`.
32+
name_template: >-
33+
{{ .ProjectName }}_
34+
{{- title .Os }}_
35+
{{- if eq .Arch "amd64" }}x86_64
36+
{{- else if eq .Arch "386" }}i386
37+
{{- else }}{{ .Arch }}{{ end }}
38+
{{- if .Arm }}v{{ .Arm }}{{ end }}
39+
# use zip for windows archives
40+
format_overrides:
41+
- goos: windows
42+
format: zip
43+
44+
changelog:
45+
sort: asc
46+
filters:
47+
exclude:
48+
- "^docs:"
49+
- "^test:"
50+
51+
release:
52+
footer: >-
53+
54+
---
55+
56+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

0 commit comments

Comments
 (0)