From a8f97024926dfeb9f47ba82135d528b6365c8e09 Mon Sep 17 00:00:00 2001 From: Solomon Jacobs Date: Mon, 13 Nov 2023 13:37:37 +0100 Subject: [PATCH] Create release workflow CMK-14985 --- .github/workflows/release.yaml | 42 +++++++++++++++++++++++++++++----- book/src/SUMMARY.md | 1 + book/src/development.md | 22 ++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 book/src/development.md diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a8ccd7e6..9174788a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,10 +1,15 @@ --- -name: "Upload all artifacts" - +name: "Release" +# Careful! This pushes a git tag to GitHub! The release itself is private. on: - push: - tags: - "**" + workflow_dispatch: + inputs: + tag: + description: > + Tag, which is set by the this GitHub workflow. + Should follow SemVer and is not allowed to exist already. + required: true + type: string jobs: tests: @@ -15,8 +20,33 @@ jobs: uses: ./.github/workflows/robotmk_build.yaml release: runs-on: ubuntu-latest - needs: [build_rcc, build_robotmk] + needs: [tests, build_rcc, build_robotmk] steps: + - uses: actions/checkout@v4 # Determines the ref, which is used for the + # release. For setting a different ref, all `needs` jobs need to be + # adjusted. Currently, everything uses the default branch. + - uses: actions/download-artifact@v3 - run: zip -r executables.zip artifact + + - name: "Push release tag" + # This is publicly visible and needs to be manually fixed if any + # consecutive step fails. + run: | + git tag ${{ inputs.tag }} # Fails, if tag exists. + git push origin ${{ inputs.tag }} + + - uses: ncipollo/release-action@v1.13.0 + with: + allowUpdates: false + artifacts: "executables.zip" + replacesArtifacts: true + removeArtifacts: true + prerelease: true + draft: true + body: "" + artifactErrorsFailBuild: true + updateOnlyUnreleased: true + makeLatest: false + tag: ${{ inputs.tag }} diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 960e440c..f6bbacf1 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -1,3 +1,4 @@ # Summary - [Consulting](./consulting.md) +- [Development](./development.md) diff --git a/book/src/development.md b/book/src/development.md new file mode 100644 index 00000000..4f78c14f --- /dev/null +++ b/book/src/development.md @@ -0,0 +1,22 @@ +# Development + +These are internal notes. + +## Release + +The release is triggered via the workflow `.github/workflows/release.yaml`. Before executing the +workflow the binaries +* the main branch needs to be in a sane state and +* the binaries should be manually tested. + +TODO: Replace manual tests by integration tests. + +The workflow can be triggered via the Action menu. Once the workflow is complete, a draft release is +available. Some basic sanity checks: +* Is the draft body correct? +* Is the title correct? +* Does `executables.zip` contain the correct binaries? + +In order to use the new release with `Checkmk`, the `omd` package `robotmk` needs to be updated. The +earliest release of `Checkmk`, which contains this `omd` package is the daily `2023.11.14`. Note, +the bakery plugin is enterprise-only.