chore(deps): update module golang.org/x/mod to v0.40.0 (#215) #177
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 Please | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| REGISTRY: ghcr.io | |
| PROD_IMAGE: ghcr.io/${{ github.repository_owner }}/ext-authz-token-exchange | |
| FAKE_TOKEN_ENDPOINT_IMAGE: ghcr.io/${{ github.repository_owner }}/ext-authz-token-exchange-fake-token-endpoint | |
| CHART_NAME: ext-authz-token-exchange | |
| CHART_PATH: charts/ext-authz-token-exchange | |
| CHART_REGISTRY: oci://ghcr.io/${{ github.repository_owner }}/charts | |
| jobs: | |
| release-please: | |
| name: Release Please | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| outputs: | |
| release_created: ${{ steps.release-please.outputs.release_created }} | |
| tag_name: ${{ steps.release-please.outputs.tag_name }} | |
| version: ${{ steps.release-please.outputs.version }} | |
| steps: | |
| - name: Create release app token | |
| id: release-app-token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| client-id: ${{ secrets.RELEASE_PLEASE_APP_CLIENT_ID }} | |
| private-key: ${{ secrets.RELEASE_PLEASE_APP_PRIVATE_KEY }} | |
| permission-contents: write | |
| permission-issues: write | |
| permission-pull-requests: write | |
| - name: Run Release Please | |
| id: release-please | |
| uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 | |
| with: | |
| token: ${{ steps.release-app-token.outputs.token }} | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| publish: | |
| name: Publish release artifacts | |
| runs-on: ubuntu-latest | |
| needs: release-please | |
| if: needs.release-please.outputs.release_created == 'true' | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| attestations: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: ./.github/actions/setup-helm | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| - name: Log in to GHCR for Docker | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push plugin image | |
| id: build-plugin | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| target: prod | |
| push: true | |
| provenance: true | |
| sbom: true | |
| build-args: | | |
| VERSION=${{ needs.release-please.outputs.version }} | |
| REVISION=${{ github.sha }} | |
| SOURCE=${{ github.server_url }}/${{ github.repository }} | |
| tags: | | |
| ${{ env.PROD_IMAGE }}:${{ needs.release-please.outputs.version }} | |
| ${{ env.PROD_IMAGE }}:sha-${{ github.sha }} | |
| - name: Attest plugin image | |
| uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 | |
| with: | |
| subject-name: ${{ env.PROD_IMAGE }} | |
| subject-digest: ${{ steps.build-plugin.outputs.digest }} | |
| push-to-registry: true | |
| - name: Build and push fake token endpoint image | |
| id: build-fake-token-endpoint | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| target: fake-token-endpoint | |
| push: true | |
| provenance: true | |
| sbom: true | |
| build-args: | | |
| VERSION=${{ needs.release-please.outputs.version }} | |
| REVISION=${{ github.sha }} | |
| SOURCE=${{ github.server_url }}/${{ github.repository }} | |
| tags: | | |
| ${{ env.FAKE_TOKEN_ENDPOINT_IMAGE }}:${{ needs.release-please.outputs.version }} | |
| ${{ env.FAKE_TOKEN_ENDPOINT_IMAGE }}:sha-${{ github.sha }} | |
| - name: Attest fake token endpoint image | |
| uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 | |
| with: | |
| subject-name: ${{ env.FAKE_TOKEN_ENDPOINT_IMAGE }} | |
| subject-digest: ${{ steps.build-fake-token-endpoint.outputs.digest }} | |
| push-to-registry: true | |
| - name: Validate release versions | |
| run: | | |
| VERSION="${{ needs.release-please.outputs.version }}" | |
| CHART_VERSION="$(awk '/^version:/ {print $2}' "${CHART_PATH}/Chart.yaml")" | |
| APP_VERSION="$(awk '/^appVersion:/ {gsub(/"/, "", $2); print $2}' "${CHART_PATH}/Chart.yaml")" | |
| test "$CHART_VERSION" = "$VERSION" | |
| test "$APP_VERSION" = "$VERSION" | |
| - name: Package and publish Helm chart | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_USERNAME: ${{ github.actor }} | |
| run: | | |
| VERSION="${{ needs.release-please.outputs.version }}" | |
| mkdir -p dist | |
| helm dependency build "${CHART_PATH}" | |
| helm package "${CHART_PATH}" --destination dist | |
| test -f "dist/${CHART_NAME}-${VERSION}.tgz" | |
| echo "$GITHUB_TOKEN" | helm registry login ghcr.io \ | |
| --username "$GITHUB_USERNAME" \ | |
| --password-stdin | |
| helm push "dist/${CHART_NAME}-${VERSION}.tgz" "${CHART_REGISTRY}" | |
| - name: Upload chart to GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload "${{ needs.release-please.outputs.tag_name }}" dist/*.tgz --clobber | |
| - name: Validate published Helm chart | |
| run: | | |
| VERSION="${{ needs.release-please.outputs.version }}" | |
| helm pull "${CHART_REGISTRY}/${CHART_NAME}" --version "$VERSION" | |
| tar -tf "${CHART_NAME}-${VERSION}.tgz" | head -10 | |
| helm show chart "${CHART_REGISTRY}/${CHART_NAME}" --version "$VERSION" | |
| helm show values "${CHART_REGISTRY}/${CHART_NAME}" --version "$VERSION" |