From 33c76ee98c122c72b496c23ce4ffa5f5ba0ab32b Mon Sep 17 00:00:00 2001 From: peb-adr Date: Wed, 30 Aug 2023 18:17:02 +0200 Subject: [PATCH] Manage versioning (#231) --- .../{release.yml => release-create.yml} | 27 ++++++++++++++----- .github/workflows/release-dev.yml | 9 +++++++ .github/workflows/release-stable.yml | 24 +++++++++++++++++ 3 files changed, 54 insertions(+), 6 deletions(-) rename .github/workflows/{release.yml => release-create.yml} (52%) create mode 100644 .github/workflows/release-dev.yml create mode 100644 .github/workflows/release-stable.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release-create.yml similarity index 52% rename from .github/workflows/release.yml rename to .github/workflows/release-create.yml index b8d0b65..0c03a91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-create.yml @@ -1,7 +1,20 @@ -name: GitHub Release +name: GitHub Release (reusable) on: - push: - branches: [main] + workflow_call: + inputs: + branch: + type: string + default: main + tag: + type: string + default: dev + title: + type: string + default: Development Build + prerelease: + type: boolean + default: true + jobs: release: name: Create GitHub Release and upload binary @@ -14,6 +27,8 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 + with: + ref: "${{ inputs.branch }}" - name: Build binaries run: go build ./cmd/openslides @@ -22,8 +37,8 @@ jobs: uses: marvinpinto/action-automatic-releases@latest with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - prerelease: true - title: "Development Build" + automatic_release_tag: "${{ inputs.tag }}" + prerelease: "${{ inputs.prerelease }}" + title: "${{ inputs.title }}" files: | openslides diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml new file mode 100644 index 0000000..e4d4718 --- /dev/null +++ b/.github/workflows/release-dev.yml @@ -0,0 +1,9 @@ +name: GitHub Release (dev) +on: + push: + branches: [main] + +jobs: + release-dev: + name: "Create dev Release" + uses: ./.github/workflows/release-create.yml diff --git a/.github/workflows/release-stable.yml b/.github/workflows/release-stable.yml new file mode 100644 index 0000000..4eef664 --- /dev/null +++ b/.github/workflows/release-stable.yml @@ -0,0 +1,24 @@ +name: GitHub Release (stable) +on: + repository_dispatch: + types: [stable-update] + +jobs: + release-stable: + name: "Create GitHub Release (4.x.x) and upload binary" + if: startsWith(github.event.client_payload.branch, 'stable/4') + uses: ./.github/workflows/release-create.yml + with: + branch: "${{ github.event.client_payload.branch }}" + tag: "${{ github.event.client_payload.version }}" + title: Stable Build + prerelease: false + release-stable-latest: + name: "Create GitHub Release (latest) and upload binary" + if: startsWith(github.event.client_payload.branch, 'stable/4') + uses: ./.github/workflows/release-create.yml + with: + branch: "${{ github.event.client_payload.branch }}" + tag: latest + title: Stable Build + prerelease: false