| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- name: Create Release
- on:
- workflow_dispatch:
- inputs:
- version:
- description: 'version to release, e.g. v1.5.13'
- required: true
- default: 'v0.1.0'
- source_ref:
- description: 'source ref to publish from. E.g.: main or release-x.y'
- required: true
- default: 'main'
- env:
- IMAGE_NAME: ghcr.io/${{ github.repository }}
- permissions:
- contents: read
- jobs:
- check-docs-for-release:
- name: Check Docs for release
- runs-on: ubuntu-latest
- permissions:
- contents: read
- steps:
- - name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
- with:
- egress-policy: audit
- - name: Checkout
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.source_ref }}
- - name: check-docs
- run: |
- DOCS_VERSION=${{ github.event.inputs.version }} make docs.check
- release:
- name: Create Release
- runs-on: ubuntu-latest
- permissions:
- contents: write # to create a release and push new docs
- steps:
- - name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
- with:
- egress-policy: audit
- - name: Checkout
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.source_ref }}
- - name: Create Release
- uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
- with:
- tag_name: ${{ github.event.inputs.version }}
- target_commitish: ${{ github.event.inputs.source_ref }}
- generate_release_notes: true
- body: |
- Image: `${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}`
- NOTE - the following UBI images are not currently working (broken build process).
- Image: `${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}-ubi`
- Image: `${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}-ubi-boringssl`
- env:
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- - name: Configure Git
- run: |
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- - name: Update Docs
- if: github.ref == 'refs/heads/main'
- run: make docs.publish DOCS_VERSION=${{ github.event.inputs.version }} DOCS_ALIAS=latest
- env:
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- promote:
- name: Promote Container Image
- runs-on: ubuntu-latest
- strategy:
- matrix:
- include:
- - tag_suffix: "" # distroless image
- - tag_suffix: "-ubi" # ubi image
- - tag_suffix: "-ubi-boringssl" # ubi image
- permissions:
- contents: write #to update the github release
- id-token: write #for keyless sign
- packages: write #to update packages with added SBOMs.
- env:
- SOURCE_TAG: ${{ github.event.inputs.source_ref }}${{ matrix.tag_suffix }}
- RELEASE_TAG: ${{ github.event.inputs.version }}${{ matrix.tag_suffix }}
- steps:
- - uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
- with:
- egress-policy: audit
- - name: Checkout
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- with:
- fetch-depth: 0
- - name: Setup Go
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
- id: setup-go
- with:
- go-version-file: "go.mod"
- - name: Download Go modules
- if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
- run: go mod download
- - name: Login to Docker
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
- with:
- registry: ghcr.io
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - name: Promote Container Image
- run: make docker.promote
- - name: Build release manifests
- run: |
- # temporarily patch the version so we generate manifests with the new version
- yq e -i '.version = "${{ github.event.inputs.version }}"' ./deploy/charts/external-secrets/Chart.yaml
- yq e -i '.appVersion = "${{ github.event.inputs.version }}"' ./deploy/charts/external-secrets/Chart.yaml
- make manifests
- - name: Sign promoted image
- id: sign
- uses: ./.github/actions/sign
- with:
- image-name: ${{ env.IMAGE_NAME }}
- image-tag: ${{ env.RELEASE_TAG }}
- - name: Update Release
- uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
- with:
- tag_name: ${{ github.event.inputs.version }}
- files: |
- provenance.${{ env.RELEASE_TAG }}.intoto.jsonl
- sbom.${{ env.RELEASE_TAG }}.spdx.json
- bin/deploy/manifests/external-secrets.yaml
- env:
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|