Merge pull request #247 from techulus/feat/traefik-techulus-host-header #49
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: Agent Tip Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "agent/**" | |
| - ".github/workflows/agent-tip-release.yml" | |
| permissions: | |
| contents: write | |
| jobs: | |
| agent: | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: agent/go.mod | |
| cache-dependency-path: agent/go.sum | |
| - name: Build | |
| working-directory: agent | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: 0 | |
| run: | | |
| go build -ldflags="-s -w -X techulus/cloud-agent/internal/agent.Version=${{ github.sha }}" -o agent-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/agent | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: agent-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: agent/agent-${{ matrix.goos }}-${{ matrix.goarch }} | |
| retention-days: 1 | |
| release: | |
| needs: agent | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: binaries | |
| merge-multiple: true | |
| - name: Generate SHA256 checksums | |
| run: | | |
| cd binaries | |
| sha256sum agent-* > checksums.txt | |
| - name: Update tip release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| assets=$(gh api repos/${{ github.repository }}/releases/tags/tip --jq '.assets[].id' 2>/dev/null || echo "") | |
| for asset_id in $assets; do | |
| gh api -X DELETE repos/${{ github.repository }}/releases/assets/$asset_id | |
| done | |
| for binary in binaries/agent-*; do | |
| chmod +x "$binary" | |
| gh release upload tip "$binary" --repo ${{ github.repository }} --clobber | |
| done | |
| gh release upload tip binaries/checksums.txt --repo ${{ github.repository }} --clobber |