From af894923941f36b2ec0d7f33e7096ab467d3532b Mon Sep 17 00:00:00 2001 From: Felix Seifert Date: Mon, 18 Mar 2024 06:58:55 +0100 Subject: [PATCH] ci: add workflow to release on GitHub * This workflow can be called either directly via the web UI or indirectly via another workflow. * This worflow always requires a Git tag as an input to create a release of this exact tag. --- .github/workflows/release-on-github.yaml | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/release-on-github.yaml diff --git a/.github/workflows/release-on-github.yaml b/.github/workflows/release-on-github.yaml new file mode 100644 index 0000000..a23765d --- /dev/null +++ b/.github/workflows/release-on-github.yaml @@ -0,0 +1,30 @@ +name: Release on GitHub + +on: + workflow_dispatch: + inputs: + tag: + description: Create GitHub release of following tag + required: true + type: string + workflow_call: + inputs: + tag: + required: true + type: string + +jobs: + create-release: + + runs-on: ubuntu-latest + steps: + + - name: Create GitHub release + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/csgoh/roadmapper/releases \ + -d '{"tag_name":"${{ inputs.tag }}","target_commitish":"main","draft":false,"prerelease":false,"generate_release_notes":true}'