Skip to content

Commit c627a37

Browse files
authored
setup release workflow (#7)
1 parent e798460 commit c627a37

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

.github/workflows/release.yml

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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@
1919

2020
# Go workspace file
2121
go.work
22+
23+
dist/

.goreleaser.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
project_name: ecsplorer
2+
env:
3+
- GO111MODULE=on
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- main: .
11+
binary: ecsplorer
12+
ldflags:
13+
- -s -w
14+
- -X github.com/masaushi/ecsplorer/cmd.Version={{.Version}}
15+
env:
16+
- CGO_ENABLED=0
17+
goos:
18+
- darwin
19+
- linux
20+
- windows
21+
goarch:
22+
- amd64
23+
- arm64
24+
25+
archives:
26+
- name_template: >-
27+
{{ .ProjectName }}_
28+
{{- title .Os }}_
29+
{{- if eq .Arch "amd64" }}x86_64
30+
{{- else if eq .Arch "386" }}i386
31+
{{- else }}{{ .Arch }}{{ end }}
32+
{{- if .Arm }}v{{ .Arm }}{{ end }}
33+
files:
34+
- README.md
35+
- LICENSE
36+
format_overrides:
37+
- goos: windows
38+
format: zip
39+
40+
checksum:
41+
name_template: "checksum.txt"
42+
43+
release:
44+
prerelease: auto

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# ecsplorer
2+
[![release](https://github.com/masaushi/ecsplorer/actions/workflows/release.yml/badge.svg)](https://github.com/masaushi/ecsplorer/actions/workflows/release.yml)
3+
[![lint](https://github.com/masaushi/ecsplorer/actions/workflows/lint.yml/badge.svg)](https://github.com/masaushi/ecsplorer/actions/workflows/lint.yml)
4+
25
ecsplorer is a tool designed for easy CLI operations with AWS ECS.
36

47
## Overview

0 commit comments

Comments
 (0)