diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..73c5864 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,31 @@ +name: ci + +on: + push: + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7.0.1 + with: + fetch-depth: 0 + - uses: actions/setup-go@v7.0.0 + with: + go-version-file: go.mod + - name: gofmt + run: test -z "$(gofmt -l .)" + - run: go vet ./... + - run: go test -race ./... + - run: go run ./cmd/docs check + - uses: goreleaser/goreleaser-action@v7.3.0 + with: + distribution: goreleaser + version: v2.19.0 + args: check + - uses: goreleaser/goreleaser-action@v7.3.0 + with: + distribution: goreleaser + version: v2.19.0 + args: release --snapshot --clean diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..9e7cc7a --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,24 @@ +name: release + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7.0.1 + with: + fetch-depth: 0 + - uses: actions/setup-go@v7.0.0 + with: + go-version-file: go.mod + - uses: goreleaser/goreleaser-action@v7.3.0 + with: + distribution: goreleaser + version: v2.19.0 + args: release --clean + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..82b9abb --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,29 @@ +version: 2 +project_name: docs + +builds: + - id: docs + main: ./cmd/docs + binary: docs + env: + - CGO_ENABLED=0 + goos: [darwin, linux] + goarch: [amd64, arm64] + flags: [-trimpath] + ldflags: [-s -w] + +archives: + - formats: [tar.gz] + name_template: "docs_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + +checksum: + name_template: checksums.txt + +gitea_urls: + api: https://gitea.auvem.com/api/v1 + download: https://gitea.auvem.com + +release: + gitea: + owner: corestack + name: go