diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..36a2da4 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,31 @@ +name: basebuild + +on: + pull_request: + push: + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '>=1.18.0' + + - name: Run tests + run: go test ./... + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} diff --git a/.gitignore b/.gitignore index 79f6b07..f6ede02 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ go.work *.log lcg - +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..cceff35 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,33 @@ +archives: + - format: tar.gz + +builds: + - binary: lcg + env: + - CGO_ENABLED=0 + goarch: + - amd64 + - arm64 + - arm + goos: + - linux + - darwin + +changelog: + filters: + exclude: + - '^docs:' + - '^test:' + sort: asc + +checksum: + name_template: 'checksums.txt' + +release: + draft: true + +snapshot: + name_template: "{{ incpatch .Version }}-next" + +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj