chore(release): 0.1.2 (#41) #14
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: Helm Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Chart version to publish (without leading v, e.g. 0.1.0)" | |
| required: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write # keyless cosign signing (Sigstore OIDC) | |
| env: | |
| CHART_DIR: ./_helm/syncerd | |
| OCI_REPO: oci://ghcr.io/clouddrove/charts | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: "v3.14.0" | |
| - name: Resolve version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Log in to GHCR | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | \ | |
| helm registry login ghcr.io -u "${{ github.actor }}" --password-stdin | |
| - name: Lint chart | |
| run: helm lint "${CHART_DIR}" | |
| - name: Package chart | |
| run: | | |
| helm package "${CHART_DIR}" \ | |
| --version "${{ steps.version.outputs.version }}" \ | |
| --app-version "${{ steps.version.outputs.version }}" \ | |
| --destination dist | |
| - name: Push chart to GHCR (OCI) | |
| id: push | |
| run: | | |
| helm push dist/syncerd-${{ steps.version.outputs.version }}.tgz "${OCI_REPO}" \ | |
| 2>&1 | tee push.log | |
| digest="$(awk '/Digest: /{print $2}' push.log)" | |
| echo "digest=${digest}" >> "$GITHUB_OUTPUT" | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v3 | |
| - name: Log in to GHCR (cosign) | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | \ | |
| cosign login ghcr.io -u "${{ github.actor }}" --password-stdin | |
| - name: Sign chart (keyless) | |
| env: | |
| COSIGN_YES: "true" | |
| run: | | |
| cosign sign \ | |
| "ghcr.io/clouddrove/charts/syncerd@${{ steps.push.outputs.digest }}" | |
| - name: Install ORAS | |
| uses: oras-project/setup-oras@v1 | |
| - name: Log in to GHCR (ORAS) | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | \ | |
| oras login ghcr.io -u "${{ github.actor }}" --password-stdin | |
| - name: Push ArtifactHub repository metadata | |
| run: | | |
| oras push \ | |
| ghcr.io/clouddrove/charts/syncerd:artifacthub.io \ | |
| --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \ | |
| "${CHART_DIR}/artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml" |