Skip to content

chore(deps): update support-deps (#2723) #1693

chore(deps): update support-deps (#2723)

chore(deps): update support-deps (#2723) #1693

# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
name: Release UDS Core
# Permissions for the GITHUB_TOKEN used by the workflow.
permissions:
contents: read # Allows reading the content of the repository.
packages: read # Allows reading the content of the repository's packages.
id-token: write
on:
push:
branches:
- main
- "release/**"
jobs:
# @lulaStart d364a8e6-95ab-448c-bb97-9f456c85b54f
tag-new-version:
permissions: write-all
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.tag.outputs.release_created }}
major: ${{ steps.tag.outputs.major }}
minor: ${{ steps.tag.outputs.minor }}
steps:
- name: Create release tag
id: tag
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5
with:
target-branch: ${{ github.ref_name }}
config-file: ${{ startsWith(github.ref, 'refs/heads/release/') && 'release-please-config.patch.json' || 'release-please-config.json' }}
publish-uds-core-release:
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true' }}
permissions:
contents: write
packages: write
id-token: write
uses: ./.github/workflows/publish.yaml
with:
snapshot: false
secrets: inherit
# @lulaEnd d364a8e6-95ab-448c-bb97-9f456c85b54f
checkpoint-uds-core-release:
needs: publish-uds-core-release
permissions:
contents: read
packages: write
id-token: write
pull-requests: write
uses: ./.github/workflows/checkpoint.yaml
secrets: inherit
cut-release-branch:
needs: [publish-uds-core-release, tag-new-version]
if: ${{ needs.tag-new-version.outputs.release_created == 'true' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Create release/X.Y from vX.Y.0
shell: bash
run: |
if [[ -z "${{ needs.tag-new-version.outputs.major }}" || -z "${{ needs.tag-new-version.outputs.minor }}" ]]; then
echo "major/minor outputs missing; cannot cut release branch" >&2
exit 1
fi
BRANCH="release/${{ needs.tag-new-version.outputs.major }}.${{ needs.tag-new-version.outputs.minor }}"
TAG="v${{ needs.tag-new-version.outputs.major }}.${{ needs.tag-new-version.outputs.minor }}.0"
git fetch origin --tags
git switch -C "$BRANCH" "$TAG"
git push origin "$BRANCH"