Libdbc release v0.4.0 as release type minor #44
This file contains 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: Libdbc Release | |
run-name: Libdbc release v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }} as release type ${{ inputs.release_type }} | |
on: | |
workflow_dispatch: | |
inputs: | |
major: | |
required: true | |
description: "The major version" | |
type: number | |
minor: | |
required: true | |
description: "The minor version" | |
type: number | |
patch: | |
required: true | |
description: "The patch version" | |
type: number | |
release_type: | |
type: choice | |
description: "The type of release you are making. Controls branch naming / creation" | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
check_version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Validate version in cmake before continuing" | |
run: ./scripts/check_version.py --version "v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" | |
pipeline: | |
needs: [check_version] | |
uses: ./.github/workflows/pipeline.yml | |
create_release: | |
runs-on: ubuntu-latest | |
needs: [pipeline] | |
env: | |
header_file_path: build/single_header/libdbc/libdbc.hpp | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Setup Cargo" | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
source "$HOME/.cargo/env" | |
- name: Configure build | |
run: cmake -Bbuild -H$GITHUB_WORKSPACE -DDBC_GENERATE_SINGLE_HEADER=ON | |
- name: Generate the header file | |
run: cmake --build build --parallel `nproc` --target single_header | |
- uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
name: header-only | |
path: ${{ env.header_file_path }} | |
- name: "Create a branch if we are making a major / minor release" | |
uses: peterjgrainger/[email protected] | |
if: ${{ inputs.release_type }} == "minor" || ${{ inputs.release_type }} == "major" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
branch: 'release/v${{ inputs.major }}.${{ inputs.minor }}.X' | |
sha: '${{ github.sha }}' | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "${{ env.header_file_path }}" | |
draft: true | |
bodyFile: ".github/data/release_body.md" | |
tag: v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }} | |
commit: release/v${{ inputs.major }}.${{ inputs.minor }}.X | |