From 9ee1b163a16e6743b478af20659ad115e5ea0d3f Mon Sep 17 00:00:00 2001 From: Hayden Spitzley Date: Fri, 19 Apr 2024 11:39:14 -0600 Subject: [PATCH] release scripts --- .github/workflows/release-cli.yaml | 35 ++++++++++++++++++++++++++++++ core/cli/.goreleaser.yml | 14 ++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/release-cli.yaml create mode 100644 core/cli/.goreleaser.yml diff --git a/.github/workflows/release-cli.yaml b/.github/workflows/release-cli.yaml new file mode 100644 index 0000000..19b51e6 --- /dev/null +++ b/.github/workflows/release-cli.yaml @@ -0,0 +1,35 @@ +on: + release: + types: [published] + +name: release-cli +jobs: + go-release-cli: + runs-on: [ARM64, self-hosted, Linux] + steps: + # See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow + # For why we need to generate a token and not use the default + - name: Generate token + id: generate_token + uses: chanzuckerberg/github-app-token@v1.1.4 + with: + app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }} + private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }} + - uses: actions/checkout@v4 + # we need to fetch all history and tags, + # so we build the proper version + # NOTE: this needs to happen after the tag is created so the tag is present locally + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: core/go.mod + cache: true + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + version: latest + workdir: core/cli + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} diff --git a/core/cli/.goreleaser.yml b/core/cli/.goreleaser.yml new file mode 100644 index 0000000..edaee6c --- /dev/null +++ b/core/cli/.goreleaser.yml @@ -0,0 +1,14 @@ +project_name: argus + +release: + github: + owner: chanzuckerberg + name: argus-artifacts + +brews: + - description: "The command line tool for the Argus platform." + tap: + owner: chanzuckerberg + name: homebrew-tap + homepage: "https://github.com/chanzuckerberg/argus-artifacts" + test: system "#{bin}/argus version"