fix: auto-create k8sclaw-agent ServiceAccount, add imagePullPolicy Al… #15
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: Release CLI | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| packages: write | |
| pages: write | |
| id-token: write | |
| env: | |
| REGISTRY: ghcr.io/alexsjones/k8sclaw | |
| jobs: | |
| release-cli: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| - goos: darwin | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Build CLI | |
| env: | |
| CGO_ENABLED: "0" | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| VERSION="${GITHUB_REF_NAME}" | |
| go build -ldflags="-s -w -X main.version=${VERSION}" \ | |
| -o k8sclaw ./cmd/k8sclaw | |
| - name: Package | |
| run: | | |
| PLATFORM="${{ matrix.goos }}-${{ matrix.goarch }}" | |
| tar -czf "k8sclaw-${PLATFORM}.tar.gz" k8sclaw | |
| sha256sum "k8sclaw-${PLATFORM}.tar.gz" > "k8sclaw-${PLATFORM}.tar.gz.sha256" | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| k8sclaw-*.tar.gz | |
| k8sclaw-*.sha256 | |
| release-manifests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Package install manifests | |
| run: | | |
| tar -czf k8sclaw-manifests.tar.gz \ | |
| config/crd/bases/ \ | |
| config/manager/ \ | |
| config/rbac/ \ | |
| config/webhook/ \ | |
| config/network/ \ | |
| config/nats/ \ | |
| config/cert/ | |
| - name: Upload manifests | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: k8sclaw-manifests.tar.gz | |
| release-images: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| image: | |
| - controller | |
| - apiserver | |
| - ipc-bridge | |
| - webhook | |
| - channel-telegram | |
| - channel-whatsapp | |
| - channel-discord | |
| - channel-slack | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ matrix.image }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=raw,value=latest | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: images/${{ matrix.image }}/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy-pages: | |
| runs-on: ubuntu-latest | |
| needs: release-cli | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Prepare site | |
| run: | | |
| mkdir -p _site | |
| cp index.html install.sh CNAME icon.svg _site/ | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |