Skip to content

chore: bump fcc image version to v0.1.7 (#88) #81

chore: bump fcc image version to v0.1.7 (#88)

chore: bump fcc image version to v0.1.7 (#88) #81

Workflow file for this run

name: GoRelease
permissions:
contents: read
on:
pull_request:
paths:
- .github/workflows/release.yml
push:
tags:
- '*/v*.*.*'
workflow_dispatch:
env:
GITHUB_REF: ${{ github.ref }}
defaults:
run:
working-directory: go/src/open-cluster-management.io/lab
jobs:
env:
name: prepare release env
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v5
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/lab
- name: prepare release environment
id: prepare-env
uses: ./go/src/open-cluster-management.io/lab/.github/actions/prepare-release-env
with:
github_ref: ${{ github.ref }}
outputs:
MAJOR_RELEASE_VERSION: ${{ steps.prepare-env.outputs.MAJOR_RELEASE_VERSION }}
RELEASE_VERSION: ${{ steps.prepare-env.outputs.RELEASE_VERSION }}
TRIMMED_RELEASE_VERSION: ${{ steps.prepare-env.outputs.TRIMMED_RELEASE_VERSION }}
MATRIX: ${{ steps.prepare-env.outputs.MATRIX }}
release:
name: release
runs-on: ubuntu-latest
needs: [ env ]
permissions:
contents: write
strategy:
matrix: ${{ fromJson(needs.env.outputs.MATRIX) }}
steps:
- name: checkout code
uses: actions/checkout@v5
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/lab
- 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 }} ${{ matrix.repository }} ${{ 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: |
set -e
mkdir -p release
pushd release
# assert that the default image tag in values.yaml matches the release version
chartImageTag=$(yq eval '.image.tag' ../${{ matrix.repository }}/charts/${{ matrix.repository }}/values.yaml)
if [[ "$chartImageTag" != "${{ needs.env.outputs.RELEASE_VERSION }}" && "$chartImageTag" != "${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }}" ]]; then
echo "Error: .image.tag in values.yaml ($chartImageTag) does not match the release version (${{ needs.env.outputs.RELEASE_VERSION }}) or the trimmed release version (${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }})"
exit 1
fi
# stage helm dependencies and package the chart
yq eval '.dependencies[] | .name + " " + .repository' ../${{ matrix.repository }}/charts/${{ matrix.repository }}/Chart.yaml | while read -r repo_name repo_url; do
if [[ ! "$repo_url" =~ ^(oci://|file://) ]]; then
helm repo add "$repo_name" "$repo_url"
else
echo "Skipping repository $repo_url for $repo_name"
fi
done
helm repo update
helm dependency build ../${{ matrix.repository }}/charts/${{ matrix.repository }}
helm package ../${{ matrix.repository }}/charts/${{ matrix.repository }} \
--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/lab/lab/go/src/open-cluster-management.io/lab/release/*.tgz