diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml new file mode 100644 index 0000000..2371e0b --- /dev/null +++ b/.github/workflows/build-test-release.yml @@ -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 diff --git a/.gitignore b/.gitignore index e251199..4db7308 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /sql.db + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..a0d15dd --- /dev/null +++ b/.goreleaser.yaml @@ -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:'