This repository was archived by the owner on Jul 15, 2026. It is now read-only.
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Build CLI and Attach to GitHub Release" | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: "Build CLI and Attach to GitHub Release" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| # Setup Go | |
| - name: "Setup Go" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: "go.mod" | |
| # Print Go version | |
| - run: go version | |
| # Build and release | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0 | |
| with: | |
| version: latest | |
| args: release --parallelism 2 --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Get Debian Package Names | |
| id: deb_package | |
| run: | | |
| echo "ARM_PACKAGE=$(find dist/ -name '*arm64.deb' | head -n 1)" >> $GITHUB_ENV | |
| echo "AMD_PACKAGE=$(find dist/ -name '*amd64.deb' | head -n 1)" >> $GITHUB_ENV | |
| # Push the Debian package to Cloudsmith | |
| - name: Push Debian ARM package to Cloudsmith | |
| id: push_arm | |
| uses: cloudsmith-io/action@7af394e0f8add4867bce109385962dafecad1b8d # v0.6.14 | |
| with: | |
| api-key: ${{ secrets.CLOUDSMITH_API_KEY }} | |
| command: "push" | |
| format: "deb" | |
| owner: "rosesecurity" | |
| repo: "terramaid" | |
| distro: "any-distro" | |
| release: "any-version" | |
| file: ${{ env.ARM_PACKAGE }} | |
| - name: Push Debian AMD package to Cloudsmith | |
| id: push_amd | |
| uses: cloudsmith-io/action@7af394e0f8add4867bce109385962dafecad1b8d # v0.6.14 | |
| with: | |
| api-key: ${{ secrets.CLOUDSMITH_API_KEY }} | |
| command: "push" | |
| format: "deb" | |
| owner: "rosesecurity" | |
| repo: "terramaid" | |
| distro: "any-distro" | |
| release: "any-version" | |
| file: ${{ env.AMD_PACKAGE }} | |
| docker: | |
| name: "Build and Push Docker Image" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Get version number | |
| id: version | |
| run: | | |
| version=$(echo "${{ github.ref }}" | awk -F"/" '{print $NF}' ) | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: rosesecurity/terramaid:${{ steps.version.outputs.version }} | |
| homebrew: | |
| name: "Bump Homebrew Formula" | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - uses: mislav/bump-homebrew-formula-action@ccf2332299a883f6af50a1d2d41e5df7904dd769 # v4.1 | |
| with: | |
| # A PR will be sent to github.com/Homebrew/homebrew-core to update this formula: | |
| formula-name: terramaid | |
| formula-path: Formula/t/terramaid.rb | |
| env: | |
| COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} |