|
| 1 | +name: Prepare release |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - .github/workflows/prepare-release.yml |
| 7 | + |
| 8 | +jobs: |
| 9 | + prepare: |
| 10 | + name: "Prepare release" |
| 11 | + runs-on: ubuntu-latest |
| 12 | + if: github.repository == 'github/codeql-action' |
| 13 | + |
| 14 | + permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | + outputs: |
| 18 | + version: ${{ steps.versions.outputs.version }} |
| 19 | + major_version: ${{ steps.versions.outputs.major_version }} |
| 20 | + latest_tag: ${{ steps.versions.outputs.latest_tag }} |
| 21 | + backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }} |
| 22 | + backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }} |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v5 |
| 27 | + with: |
| 28 | + fetch-depth: 0 # Need full history for calculation of diffs |
| 29 | + |
| 30 | + - name: Configure runner for release |
| 31 | + uses: ./.github/actions/release-initialise |
| 32 | + |
| 33 | + - name: Get version tags |
| 34 | + id: versions |
| 35 | + run: | |
| 36 | + VERSION="v$(jq '.version' -r 'package.json')" |
| 37 | + echo "version=${VERSION}" >> $GITHUB_OUTPUT |
| 38 | + MAJOR_VERSION=$(cut -d '.' -f1 <<< "${VERSION}") |
| 39 | + echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT |
| 40 | + LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -1) |
| 41 | + echo "latest_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT |
| 42 | +
|
| 43 | + - name: Determine older release branches |
| 44 | + id: branches |
| 45 | + uses: ./.github/actions/release-branches |
| 46 | + with: |
| 47 | + major_version: ${{ steps.versions.outputs.major_version }} |
| 48 | + latest_tag: ${{ steps.versions.outputs.latest_tag }} |
| 49 | + |
| 50 | + - name: Print release information |
| 51 | + run: | |
| 52 | + echo 'version: ${{ steps.versions.outputs.version }}' |
| 53 | + echo 'major_version: ${{ steps.versions.outputs.major_version }}' |
| 54 | + echo 'latest_tag: ${{ steps.versions.outputs.latest_tag }}' |
| 55 | + echo 'backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }}' |
| 56 | + echo 'backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }}' |
0 commit comments