diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..8eae9b6 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,38 @@ +name: Build & Test +on: + push: + branches: + - "**" + +jobs: + Main: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.21.5 + - + name: Run linter + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 + - + name: Run tests + run: go test ./... + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: 1.22.1 + args: release --clean --snapshot + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GORELEASER_FORCE_TOKEN: gitea diff --git a/.gitea/workflows/release-tag.yaml b/.gitea/workflows/release-tag.yaml new file mode 100644 index 0000000..3028901 --- /dev/null +++ b/.gitea/workflows/release-tag.yaml @@ -0,0 +1,30 @@ +name: Release +on: + push: + tags: + - v* + +jobs: + Release: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.21 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: 1.22.1 + args: release --clean + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GORELEASER_FORCE_TOKEN: gitea diff --git a/.gitignore b/.gitignore index aaa34ed..e137124 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /datashake /release datashake.json + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..d6b83ad --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,46 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +gitea_urls: + api: https://code.humancabbage.net/api/v1 + download: http://code.humancabbage.net