Skip to content

Commit

Permalink
ci: add test and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlindhe committed Jan 19, 2024
1 parent c3f42f2 commit eaacb56
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [push, pull_request]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: go test -v -race ./...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist

31 changes: 31 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build customization
builds:
- id: imgcat
main: ./main.go
binary: imgcat
goos:
- windows
- darwin
- linux
goarch:
- 386
- amd64
ignore:
- goos: darwin
goarch: 386

archives:
- id: tgz
format: tar.gz
format_overrides:
- goos: windows
format: zip
files:
- README.md
- LICENSE

checksum:
name_template: 'checksums.txt'

changelog:
sort: asc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NOTE: requires iTerm2 2.9 or newer.

# Install command line

go get -u github.com/martinlindhe/imgcat
go install github.com/martinlindhe/imgcat@latest


# Use the lib in your terminal app
Expand Down

0 comments on commit eaacb56

Please sign in to comment.