chore(deps): update dependency fluxcd/helm-controller to v1.4.2 (#100) #127
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: Versioned Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write # we need this to be able to push tags | |
| pull-requests: read # we need this to be able to read pull-requests body | |
| issues: read # we need this to be able to read pull-requests body | |
| packages: write # we need this to be able to push ocm packages | |
| attestations: write # we need this to be able to push ocm packages | |
| id-token: write # we need this to be able to push ocm packages | |
| env: | |
| OCI_URL: ghcr.io/openmcp-project/components | |
| jobs: | |
| release_tag: | |
| name: Release version | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| ssh-key: ${{ secrets.PUSH_KEY }} | |
| fetch-tags: true | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Read and validate VERSION | |
| id: version | |
| run: | | |
| VERSION=$(cat VERSION) | |
| if [[ ! "$VERSION" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-dev(-[0-9a-f]*)?)?$ ]]; then | |
| echo "Invalid version format: $VERSION" | |
| exit 1 | |
| fi | |
| echo "New version: $VERSION" | |
| echo "version=$VERSION" >> $GITHUB_ENV | |
| - name: Check if VERSION is already tagged | |
| id: check_tag | |
| run: | | |
| if git rev-parse "refs/tags/${{ env.version }}" >/dev/null 2>&1; then | |
| echo "Tag ${{ env.version }} already exists. Skipping release." | |
| echo "SKIP=true" >> $GITHUB_ENV | |
| exit 0 | |
| fi | |
| echo "Tag ${{ env.version }} doesn't exists. Proceeding with release." | |
| - name: Skip release if version is a dev version | |
| if: contains(env.version, '-dev') | |
| run: | | |
| echo "Skipping development version release: ${{ env.version }}" | |
| echo "SKIP=true" >> $GITHUB_ENV | |
| exit 0 | |
| - name: Create Git tag | |
| if: ${{ env.SKIP != 'true' }} | |
| run: | | |
| AUTHOR_NAME=$(git log -1 --pretty=format:'%an') | |
| AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae') | |
| echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>" | |
| echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV | |
| echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV | |
| git config user.name "$AUTHOR_NAME" | |
| git config user.email "$AUTHOR_EMAIL" | |
| git tag -a "${{ env.version }}" -m "Release ${{ env.version }}" | |
| git push origin "${{ env.version }}" | |
| - name: setup OCM | |
| if: ${{ env.SKIP != 'true' }} | |
| uses: open-component-model/ocm-setup-action@main | |
| - name: Create OCM CTF | |
| if: ${{ env.SKIP != 'true' }} | |
| run: | | |
| ocm add componentversions --create \ | |
| --file openmcp-ctf component-constructor.yaml \ | |
| --settings components-versions.yaml -- OPENMCP_VERSION=${{ env.version }} OPENMCP_VERSION_COMMIT=$(git show-ref --hash ${{ env.version }}) | |
| - name: Build Changelog | |
| if: ${{ env.SKIP != 'true' }} | |
| id: constructed_release | |
| run: | | |
| cat hack/release-body.tpl > RELEASE_BODY.md | |
| echo -e "## Components:\n" >> RELEASE_BODY.md | |
| ./hack/generate_release_notes.sh openmcp-ctf >> RELEASE_BODY.md | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Create GitHub release | |
| if: ${{ env.SKIP != 'true' }} | |
| uses: softprops/action-gh-release@aec2ec56f94eb8180ceec724245f64ef008b89f5 # v2 | |
| with: | |
| tag_name: ${{ env.version }} | |
| name: Release ${{ env.version }} | |
| body_path: RELEASE_BODY.md | |
| draft: true | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| if: ${{ env.SKIP != 'true' }} | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push CTF | |
| if: ${{ env.SKIP != 'true' }} | |
| run: | | |
| ocm transfer ctf --copy-resources ./openmcp-ctf/ ${{ env.OCI_URL }} |