Files
open-cluster-management/.github/workflows/release.yml
dependabot[bot] c2052861e0 🌱 Bump the github-actions group with 5 updates (#1407)
Bumps the github-actions group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [step-security/harden-runner](https://github.com/step-security/harden-runner) | `2.14.2` | `2.15.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `6.0.0` | `7.0.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `4.32.4` | `4.32.5` |
| [actions/attest-sbom](https://github.com/actions/attest-sbom) | `3` | `4` |
| [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) | `3` | `4` |


Updates `step-security/harden-runner` from 2.14.2 to 2.15.0
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](5ef0c079ce...a90bcbc653)

Updates `actions/upload-artifact` from 6.0.0 to 7.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

Updates `github/codeql-action` from 4.32.4 to 4.32.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](89a39a4e59...c793b717bc)

Updates `actions/attest-sbom` from 3 to 4
- [Release notes](https://github.com/actions/attest-sbom/releases)
- [Changelog](https://github.com/actions/attest-sbom/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest-sbom/compare/v3...v4)

Updates `actions/attest-build-provenance` from 3 to 4
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest-build-provenance/compare/v3...v4)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-version: 4.32.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/attest-sbom
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/attest-build-provenance
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 14:23:15 +00:00

90 lines
3.0 KiB
YAML

name: GoRelease
permissions:
contents: read
on:
push:
tags:
- 'v*.*.*'
env:
GITHUB_REF: ${{ github.ref }}
defaults:
run:
working-directory: go/src/open-cluster-management.io/ocm
jobs:
env:
name: prepare release env
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/ocm
- name: get release version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: get major release version
run: |
echo "MAJOR_RELEASE_VERSION=${RELEASE_VERSION%.*}" >> $GITHUB_ENV
echo "TRIMMED_RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
outputs:
MAJOR_RELEASE_VERSION: ${{ env.MAJOR_RELEASE_VERSION }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
TRIMMED_RELEASE_VERSION: ${{ env.TRIMMED_RELEASE_VERSION }}
release:
name: release
runs-on: ubuntu-latest
needs: [ env ]
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: checkout code
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/ocm
- name: set up Python 3.x
uses: actions/setup-python@v6
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub
- name: generate changelog
run: |
python hack/changelog.py ${{ secrets.GITHUB_TOKEN }} ${{ needs.env.outputs.RELEASE_VERSION }} > /home/runner/work/changelog.txt
cat /home/runner/work/changelog.txt
- name: setup helm
uses: azure/setup-helm@v4
- name: chart package
if: github.event_name != 'pull_request'
run: |
mkdir -p release
pushd release
helm package ../deploy/cluster-manager/chart/cluster-manager --app-version ${{ needs.env.outputs.RELEASE_VERSION }} --version ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }}
helm package ../deploy/klusterlet/chart/klusterlet --app-version ${{ needs.env.outputs.RELEASE_VERSION }} --version ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }}
popd
- name: publish release
if: github.event_name != 'pull_request'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: /home/runner/work/changelog.txt
draft: true
generate_release_notes: true
files: |
/home/runner/work/ocm/ocm/go/src/open-cluster-management.io/ocm/release/*.tgz
- name: generate helm charts attestation
uses: actions/attest-build-provenance@v4
with:
subject-path: '/home/runner/work/ocm/ocm/go/src/open-cluster-management.io/ocm/release/*.tgz'