Skip to content

Commit

Permalink
Add release workflow and GoReleaser config
Browse files Browse the repository at this point in the history
- Introduce a GitHub Actions workflow for automated releases.
- Add GoReleaser configuration to automate binary builds and packaging.
- Update .gitignore to exclude dist directory.
  • Loading branch information
ammario committed Aug 31, 2024
1 parent 3c956ec commit 2f4facd
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
push:
tags:
- "v*"
workflow_dispatch:

# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: "go.mod"
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/aicommit
dist
54 changes: 54 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: 2
builds:
- main: "./cmd/aicommit"
env:
- CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- "-s -w -X main.Version={{.Version}}"
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- "386"
- arm
- arm64
goarm:
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: windows
goarch: "arm"

This comment has been minimized.

Copy link
@coadler

coadler Aug 31, 2024

Member

You can prob enable windows arm if you wanted, i just couldn't get tailscale compiling for it

This comment has been minimized.

Copy link
@ammario

ammario Aug 31, 2024

Author Member

ah fixed

binary: "{{ .ProjectName }}"
nfpms:
- vendor: Coder Technologies Inc.
homepage: https://coder.com/
maintainer: Ammar Bandukwala <[email protected]>
description: |-
aicommit is a small command line tool for generating commit messages
license: CC0-1.0
contents:
- src: LICENSE
dst: "/usr/share/doc/{{ .ProjectName }}/copyright"
formats:
- apk
- deb
archives:
- id: "zip"
format: zip
- id: "tarball"
format: tar.gz
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256

# release:
# draft: true
changelog:
use: github-native

0 comments on commit 2f4facd

Please sign in to comment.