From 6285ee7e031f7d16458a8a5ee7fe18aa7452baad Mon Sep 17 00:00:00 2001 From: Christian Zunker Date: Tue, 14 May 2024 17:27:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Automatically=20create=20GH=20re?= =?UTF-8?q?lease=20after=20cnspec=20bump?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Zunker --- .github/workflows/cnspec-update.yml | 1 + .github/workflows/gh-release.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/gh-release.yaml diff --git a/.github/workflows/cnspec-update.yml b/.github/workflows/cnspec-update.yml index 2ac6578..1b7863d 100644 --- a/.github/workflows/cnspec-update.yml +++ b/.github/workflows/cnspec-update.yml @@ -55,6 +55,7 @@ jobs: MAJOR=$(echo "${{ steps.version.outputs.version }}" | cut -d. -f1) go get go.mondoo.com/cnspec/${MAJOR}@${{ steps.version.outputs.version }} go mod tidy + echo "${{ steps.version.outputs.version }}" > VERSION - name: Prepare title and branch name id: branch diff --git a/.github/workflows/gh-release.yaml b/.github/workflows/gh-release.yaml new file mode 100644 index 0000000..f52569a --- /dev/null +++ b/.github/workflows/gh-release.yaml @@ -0,0 +1,26 @@ +name: Create GitHub Release + +## Only trigger release when the VERSION file changed +on: + push: + paths: + - "VERSION" + +jobs: + create-gh-release: + name: GH Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set release version + run: echo "RELEASE_VERSION=$(cat VERSION)" >> $GITHUB_ENV + - name: Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.RELEASE_VERSION }} + generate_release_notes: true + make_latest: true + # for testing purposes + draft: true +