Merge pull request #99 from linuxfoundation/feat/search-members-inclu… #57
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
| # Copyright The Linux Foundation and each contributor to LFX. | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| name: Publish Tagged Release | |
| "on": | |
| push: | |
| tags: | |
| - v* | |
| env: | |
| COSIGN_VERSION: v3.0.2 | |
| HELM_VERSION: 4.0.4 | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| name: Publish Tagged Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| outputs: | |
| app_version: ${{ steps.prepare.outputs.app_version }} | |
| chart_name: ${{ steps.prepare.outputs.chart_name }} | |
| chart_version: ${{ steps.prepare.outputs.chart_version }} | |
| digest: ${{ steps.build.outputs.digest }} | |
| image_name: ${{ steps.build.outputs.image_name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Prepare versions | |
| id: prepare | |
| run: | | |
| set -euo pipefail | |
| APP_VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//') | |
| CHART_NAME="$(yq '.name' charts/*/Chart.yaml)" | |
| CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//') | |
| { | |
| echo "app_version=$APP_VERSION" | |
| echo "chart_name=$CHART_NAME" | |
| echo "chart_version=$CHART_VERSION" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Setup Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Setup Ko | |
| uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 | |
| with: | |
| version: v0.18.0 | |
| - name: Build and publish lfx-mcp-server image | |
| id: build | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| ko build github.com/linuxfoundation/lfx-mcp/cmd/lfx-mcp-server \ | |
| -B \ | |
| --platform linux/amd64,linux/arm64 \ | |
| -t ${{ github.ref_name }} \ | |
| -t ${{ steps.prepare.outputs.app_version }} \ | |
| -t latest \ | |
| --sbom spdx \ | |
| --image-refs /tmp/image-refs.txt | |
| DIGEST=$(tail -1 /tmp/image-refs.txt | cut -d'@' -f2) | |
| IMAGE_NAME=$(tail -1 /tmp/image-refs.txt | cut -d'@' -f1) | |
| echo "digest=$DIGEST" >> "$GITHUB_OUTPUT" | |
| echo "image_name=$IMAGE_NAME" >> "$GITHUB_OUTPUT" | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0 | |
| with: | |
| cosign-release: "${{ env.COSIGN_VERSION }}" | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Sign the container image | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| cosign sign --yes '${{ steps.build.outputs.image_name }}@${{ steps.build.outputs.digest }}' | |
| release-helm-chart: | |
| needs: | |
| - publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| outputs: | |
| digest: ${{ steps.publish-ghcr.outputs.digest }} | |
| image_name: ${{ steps.publish-ghcr.outputs.image_name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Publish Chart to GHCR | |
| id: publish-ghcr | |
| # yamllint disable-line rule:line-length | |
| uses: linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@17e4144d7ba68f7c3e8c16eece5aed15fd7c2dc8 # main | |
| with: | |
| name: ${{ needs.publish.outputs.chart_name }} | |
| repository: ${{ github.repository }}/chart | |
| chart_version: ${{ needs.publish.outputs.chart_version }} | |
| app_version: ${{ needs.publish.outputs.app_version }} | |
| helm_version: "${{ env.HELM_VERSION }}" | |
| registry: ghcr.io | |
| registry_username: ${{ github.actor }} | |
| registry_password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0 | |
| with: | |
| cosign-release: "${{ env.COSIGN_VERSION }}" | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Sign the Helm chart in GHCR | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| cosign sign --yes '${{ steps.publish-ghcr.outputs.image_name }}@${{ steps.publish-ghcr.outputs.digest }}' | |
| create-ghcr-helm-provenance: | |
| needs: | |
| - release-helm-chart | |
| permissions: | |
| actions: read | |
| id-token: write | |
| packages: write | |
| uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0 | |
| with: | |
| image: ${{ needs.release-helm-chart.outputs.image_name }} | |
| digest: ${{ needs.release-helm-chart.outputs.digest }} | |
| registry-username: ${{ github.actor }} | |
| secrets: | |
| registry-password: ${{ secrets.GITHUB_TOKEN }} | |
| create-provenance: | |
| needs: | |
| - publish | |
| permissions: | |
| actions: read | |
| id-token: write | |
| packages: write | |
| uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0 | |
| with: | |
| image: ${{ needs.publish.outputs.image_name }} | |
| digest: ${{ needs.publish.outputs.digest }} | |
| registry-username: ${{ github.actor }} | |
| secrets: | |
| registry-password: ${{ secrets.GITHUB_TOKEN }} |