diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 332189ce..4f85fbbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ name: build on: pull_request: push: + workflow_dispatch: jobs: goreleaser: @@ -29,3 +30,4 @@ jobs: HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} AUR_KEY: ${{ secrets.AUR_KEY }} NUR_PACKAGES_GITHUB_TOKEN: ${{ secrets.NUR_PACKAGES_GITHUB_TOKEN }} + CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03cfea6d..059b59a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,14 @@ on: create: tags: - v* + workflow_dispatch: permissions: contents: write +env: + CHOCOLATEY_VERSION: 2.2.2 + jobs: goreleaser: runs-on: ubuntu-latest @@ -24,6 +28,20 @@ jobs: fetch-depth: 0 - name: Install Nix uses: cachix/install-nix-action@v23 + - name: Install Snapcraft & Chocolatey + # from https://github.com/twpayne/chezmoi/blob/5293b40b48e678c461d68d06b635010173cac970/.github/workflows/main.yml#L154C1-L167C38 + run: | + sudo apt-get --quiet update + sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft + # https://github.com/goreleaser/goreleaser/issues/1715 + # https://bugs.launchpad.net/snapcraft/+bug/1889741 + mkdir -p "${HOME}/.cache/snapcraft/download" + mkdir -p "${HOME}/.cache/snapcraft/stage-packages" + mkdir -p /opt/chocolatey + wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey" + echo '#!/bin/bash' >> /usr/local/bin/choco + echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco + chmod +x /usr/local/bin/choco - name: Set up Go uses: actions/setup-go@v4 with: @@ -39,3 +57,4 @@ jobs: HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} AUR_KEY: ${{ secrets.AUR_KEY }} NUR_PACKAGES_GITHUB_TOKEN: ${{ secrets.NUR_PACKAGES_GITHUB_TOKEN }} + CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} diff --git a/.gitignore b/.gitignore index 4e26eab8..dffe59e7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ dist/ id_ed25519* vendor ignore.gif -**/*/my_logs.txt \ No newline at end of file +**/*/my_logs.txt +opt diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 797d513c..249fa8f5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -21,7 +21,10 @@ builds: - windows archives: - - name_template: >- + - format_overrides: + - goos: windows + format: zip + name_template: >- {{ .ProjectName }}_{{ .Version }}_ {{- if eq .Os "darwin" }}Darwin {{- else if eq .Os "linux" }}Linux @@ -98,5 +101,59 @@ nix: branch: main token: "{{ .Env.NUR_PACKAGES_GITHUB_TOKEN }}" +winget: + - name: wander + publisher: robinovitch61 + license: MIT + copyright: "Leo Robinovitch" + homepage: https://github.com/robinovitch61/wander + short_description: "An efficient terminal application/TUI for interacting with your HashiCorp Nomad cluster." + package_identifier: "robinovitch61.wander" + repository: + owner: "robinovitch61" + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + name: winget-pkgs + branch: "{{.ProjectName}}-{{.Version}}" + pull_request: + enabled: true + draft: false + base: + owner: microsoft + name: winget-pkgs + branch: master + +scoops: + - repository: + owner: "robinovitch61" + name: scoop-bucket + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + commit_author: + name: goreleaserbot + email: goreleaserbot@theleo.zone + homepage: https://github.com/robinovitch61/wander + description: "An efficient terminal application/TUI for interacting with your HashiCorp Nomad cluster." + license: MIT + +chocolateys: + - owners: "Leo Robinovitch" + authors: "Leo Robinovitch" + project_url: https://github.com/robinovitch61/wander + url_template: "https://github.com/robinovitch61/wander/releases/download/{{ .Tag }}/{{ .ArtifactName }}" + license_url: https://github.com/robinovitch61/wander/blob/main/LICENSE + require_license_acceptance: false + project_source_url: https://github.com/robinovitch61/wander + docs_url: https://github.com/robinovitch61/wander/blob/main/README.md + bug_tracker_url: https://github.com/robinovitch61/wander/issues + tags: "wander nomad hashicorp tui" + summary: "An efficient terminal application/TUI for interacting with your HashiCorp Nomad cluster." + description: | + # An efficient terminal application/TUI for interacting with your HashiCorp Nomad cluster. + + https://github.com/robinovitch61/wander for installation, configuration, and usage instructions. + release_notes: "https://github.com/robinovitch61/wander/releases/tag/v{{ .Version }}" + api_key: "{{ .Env.CHOCOLATEY_API_KEY }}" + source_repo: "https://push.chocolatey.org/" + skip_publish: false + gomod: proxy: true