Skip to content

Commit 5c35353

Browse files
committed
feat: goreleaser action
1 parent 7d610dc commit 5c35353

3 files changed

Lines changed: 89 additions & 112 deletions

File tree

.github/workflows/build.yaml

Lines changed: 0 additions & 112 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags like v1.0.0
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
name: Run GoReleaser
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
packages: write
16+
# issues: write
17+
# id-token: write
18+
19+
steps:
20+
# Checkout the code
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
# Set up Go environment
25+
- name: Set up Go
26+
uses: actions/setup-go@v4
27+
with:
28+
go-version: 1.20
29+
30+
# Install GoReleaser
31+
- name: Install GoReleaser
32+
uses: goreleaser/goreleaser-action@v4
33+
with:
34+
version: latest
35+
36+
# Run GoReleaser
37+
- name: Run GoReleaser
38+
run: goreleaser release --clean
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+

.goreleaser.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# GoReleaser configuration file
2+
3+
# General settings
4+
project_name: chargeflow
5+
builds:
6+
- id: cli
7+
main: ./main.go
8+
binary: chargeflow
9+
goos:
10+
- freebsd
11+
- windows
12+
- darwin
13+
- linux
14+
goarch:
15+
- amd64
16+
- arm64
17+
- arm
18+
19+
archives:
20+
- id: cli-archive
21+
format: tar.gz
22+
files:
23+
- chargepi
24+
- LICENSE
25+
- README.md
26+
27+
dockers:
28+
- image_templates:
29+
- "ghcr.io/${{ .Env.GITHUB_REPOSITORY_OWNER }}/chargeflow:{{ .Version }}"
30+
- "ghcr.io/${{ .Env.GITHUB_REPOSITORY_OWNER }}/chargeflow:latest"
31+
dockerfile: ./build/Dockerfile
32+
platforms:
33+
- linux/amd64
34+
- linux/arm64
35+
36+
release:
37+
github:
38+
owner: ${{ .Env.GITHUB_REPOSITORY_OWNER }}
39+
name: ${{ .Env.GITHUB_REPOSITORY_NAME }}
40+
draft: false
41+
prerelease: false
42+
43+
changelog:
44+
sort: asc
45+
filters:
46+
exclude:
47+
- '**/*.md'
48+

0 commit comments

Comments
 (0)