Skip to content

Commit 3e78b6d

Browse files
authored
build: save compilations for various machines to releases when tags are created (#2)
1 parent 214a2c6 commit 3e78b6d

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
name: Tag release
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
jobs:
8+
release:
9+
name: Upload
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4.2.2
17+
with:
18+
fetch-depth: 0
19+
- name: Install a flaked Nix
20+
uses: DeterminateSystems/nix-installer-action@v17
21+
- name: Publish artifacts
22+
run: |
23+
nix develop -c goreleaser release --clean
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.zig-cache
44

55
# Build
6+
dist
67
zig-out
78

89
# Test

.goreleaser.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
version: 2
3+
builds:
4+
- id: git-coverage
5+
builder: zig
6+
flags:
7+
- -Doptimize=ReleaseSmall
8+
targets:
9+
- x86_64-linux
10+
- x86_64-macos
11+
- x86_64-windows
12+
- aarch64-linux
13+
- aarch64-macos
14+
archives:
15+
- formats:
16+
- tar.gz
17+
name_template: >-
18+
{{ .ProjectName }}_
19+
{{- title .Os }}_
20+
{{- if eq .Arch "amd64" }}x86_64
21+
{{- else if eq .Arch "386" }}i386
22+
{{- else }}{{ .Arch }}{{ end }}
23+
format_overrides:
24+
- goos: windows
25+
formats:
26+
- zip

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ to [Semantic Versioning][semver].
1010
### Maintenance
1111

1212
- Upload reports of test coverage to Codecov to complete proofs of concept.
13+
- Save compilations for various machines to releases when tags are created.
1314

1415
## [0.1.0] - 2025-05-03
1516

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
devShells.default = pkgs.mkShell {
3030
packages = [
3131
pkgs.git # https://github.com/git/git
32+
pkgs.goreleaser # https://github.com/goreleaser/goreleaser
3233
kcov # https://github.com/SimonKagstrom/kcov
3334
pkgs.zig # https://github.com/ziglang/zig
3435
];

0 commit comments

Comments
 (0)