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