diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 2c490f8..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow will build the dredger packages -name: Go - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22' - - - name: Set up tools - run: | - go install golang.org/x/tools/cmd/goimports@latest - go install github.com/a-h/templ/cmd/templ@latest - - - name: Templ - run: templ generate web/pages/*.templ - - - name: Build - run: go build -o dredger - - - name: Release linux binary - uses: Shopify/upload-to-release@v2.0.0 - with: - name: Linux Binary - path: dredger - diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml new file mode 100644 index 0000000..2ba7f2d --- /dev/null +++ b/.github/workflows/releaser.yml @@ -0,0 +1,36 @@ +# This workflow will publish the artifacts with goreleaser +name: Release + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: write + packages: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version: 1.22 + cache: true + - name: Set up tools + run: | + go install golang.org/x/tools/cmd/goimports@latest + go install github.com/a-h/templ/cmd/templ@latest + - name: Templ + run: templ generate web/pages/*.templ + - uses: goreleaser/goreleaser-action@v5 + with: + version: v1.24.0 + args: release --clean + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' \ No newline at end of file diff --git a/generator/.goreleaser.yml b/generator/.goreleaser.yml new file mode 100644 index 0000000..3dce5ae --- /dev/null +++ b/generator/.goreleaser.yml @@ -0,0 +1,51 @@ +builds: + - env: + - CGO_ENABLED=0 + dir: . + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - -s -w + goos: + - linux + - windows + - darwin + +checksum: + name_template: 'checksums.txt' + +signs: + - id: checksums + cmd: cosign + stdin: '{{ .Env.COSIGN_PASSWORD }}' + output: true + artifacts: checksum + args: + - sign-blob + - --yes + - --key + - env://COSIGN_PRIVATE_KEY + - '--output-certificate=${certificate}' + - '--output-signature=${signature}' + - '${artifact}' + +archives: + - format: tar.gz + 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 }} + +snapshot: + name_template: "{{ incpatch version }}-next" + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' \ No newline at end of file