Github Actions and Goreleaser
This commit is contained in:
parent
aa691dbc09
commit
36d0d536de
3 changed files with 70 additions and 0 deletions
35
.github/workflows/build-test-release.yml
vendored
Normal file
35
.github/workflows/build-test-release.yml
vendored
Normal file
|
@ -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
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
/sql.db
|
||||
|
||||
dist/
|
||||
|
|
33
.goreleaser.yaml
Normal file
33
.goreleaser.yaml
Normal file
|
@ -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:'
|
Loading…
Reference in a new issue