From 2d6d62d79ad0a597c8597e4fd3966b8b84e97ed5 Mon Sep 17 00:00:00 2001 From: Yakiyo Date: Tue, 29 Aug 2023 12:40:11 +0000 Subject: [PATCH] feat: init goreleaser files --- .github/workflows/release.yml | 33 +++++++++++++++++++++++ .gitignore | 2 ++ .goreleaser.yaml | 50 +++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5a89711 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: release + +on: + push: + # run only against tags + tags: + - '*' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - run: git fetch --force --tags + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: './go.mod' + + - uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index ed5d105..ebcc6f4 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ go.work # Builds tldr* + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..795827d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,50 @@ +project_name: "tilde" +before: + hooks: + - go mod tidy +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - 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 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +scoops: + - folder: pkg/scoop + commit_author: + name: goreleaserbot + email: bot@goreleaser.com + commit_msg_template: "Update scoop manifest to {{ .ProjectName }} version {{ .Tag }}" + homepage: "https://github.com/Yakiyo/scoob" + description: "Drop-in replacement cli for scoop" + depends: ["git"] + repository: + owner: "Yakiyo" + name: "scoob" + branch: "main" \ No newline at end of file