Skip to content

docs cleanup

docs cleanup #6

Workflow file for this run

name: CI
permissions:
contents: read
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24.3"
cache: true
- name: Lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
version: v2.1
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24.3"
cache: true
- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Run tests
run: task test
license-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24.3"
cache: true
- name: Install go-licences
run: go install github.com/google/go-licenses@latest
- name: Check licenses
run: go-licenses check . --allowed_licenses=Apache-2.0,MIT,BSD-3-Clause,BSD-2-Clause
build:
needs: [lint, test, license-check]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24.3"
cache: true
- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Build
run: task build
build-image:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Hub login
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
username: ${{ vars.DOCKERBUILDBOT_USERNAME }}
password: ${{ secrets.DOCKERBUILDBOT_WRITE_PAT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
with:
version: "lab:latest"
driver: cloud
endpoint: "docker/make-product-smarter"
install: true
- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Build
run: task build-image
build-for-release:
runs-on: ubuntu-latest
needs: [lint, test, build, license-check]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Hub login
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
username: ${{ vars.DOCKERBUILDBOT_USERNAME }}
password: ${{ secrets.DOCKERBUILDBOT_WRITE_PAT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
with:
version: "lab:latest"
driver: cloud
endpoint: "docker/make-product-smarter"
install: true
- name: Build binaries for all platforms
run: task cross
- name: Upload binaries
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: dist
path: |
dist/
if-no-files-found: error
retention-days: 1
sign:
needs: build-for-release
permissions:
id-token: write
pull-requests: write
contents: write
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/desktop-action-private/.github/workflows/sign.yml@main
with:
artifacts-name: dist
filter-win: windows_*/*
filter-mac: darwin_*/*
secrets: inherit
release:
runs-on: ubuntu-latest
needs: [sign]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: GitHub auth token
id: docker-write-app
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
with:
app-id: ${{ vars.DOCKER_READ_WRITE_APP_ID }}
private-key: ${{ secrets.DOCKER_READ_WRITE_APP_PRIVATE_KEY }}
owner: docker
repositories: cagent
- name: Download signed binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: dist
path: dist
- name: Fix binary permissions after upload/download
run: chmod +x ./dist/*/*
- name: Release
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
token: ${{ steps.docker-write-app.outputs.token }}
files: |
./dist/linux_arm64/cagent-linux-arm64
./dist/linux_amd64/cagent-linux-amd64
./dist/darwin_arm64/cagent-darwin-arm64
./dist/darwin_amd64/cagent-darwin-amd64
./dist/windows_arm64/cagent-windows-arm64.exe
./dist/windows_amd64/cagent-windows-amd64.exe