Skip to content

Commit

Permalink
Github Actions and Goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
orblivion committed Aug 20, 2022
1 parent aa691db commit 36d0d53
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Go package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17

- name: Test
run: go test -v ./...

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wallet-sync-server-${{ github.sha }}
path: |
dist/checksums.txt
dist/*.tar.gz
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/sql.db

dist/
33 changes: 33 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: wallet-sync-server
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=1 # for sqlite3 library
goos: # haven't figured out windows and darwin given cgo/sqlite3
- linux
goarch:
- amd64 # Necessary for cgo/sqlite3
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 36d0d53

Please sign in to comment.