surrealpatch/.github/workflows/beta.yml

60 lines
1.5 KiB
YAML
Raw Normal View History

2023-12-11 13:58:43 +00:00
# Use this workflow to trigger beta releases, both initial beta.1 and subsequent beta.x releases
name: Beta release
run-name: "Beta release (publish: ${{ inputs.publish }}, bump version: ${{ inputs.bump-version }})"
on:
workflow_dispatch:
inputs:
publish:
required: false
type: boolean
default: false
description: "Publish the beta release"
bump-version:
required: false
type: boolean
default: false
description: "Bump the version of the current beta if this is not the initial one"
defaults:
run:
shell: bash
2023-12-11 13:58:43 +00:00
permissions:
contents: write
jobs:
2023-12-11 13:58:43 +00:00
checks:
name: Pre-release checks
runs-on: ubuntu-latest
2023-12-11 13:58:43 +00:00
outputs:
branch: ${{ steps.outputs.outputs.branch }}
steps:
2023-12-11 13:58:43 +00:00
- uses: actions/checkout@v4
with:
2023-12-11 13:58:43 +00:00
fetch-depth: 0
2023-12-11 13:58:43 +00:00
- name: Determine the correct branch
id: outputs
run: |
set -x
2023-12-11 13:58:43 +00:00
if git branch -r | grep -w 'releases/beta'; then
echo "branch=releases/beta" >> $GITHUB_OUTPUT
else
echo "branch=main" >> $GITHUB_OUTPUT
fi
release:
name: Prepare beta release
needs: [checks]
uses: ./.github/workflows/reusable_publish_version.yml
with:
environment: beta
git-ref: ${{ needs.checks.outputs.branch }}
bump-version: ${{ inputs.bump-version }}
2023-12-11 13:58:43 +00:00
publish: ${{ inputs.publish }}
create-release: ${{ inputs.publish }}
secrets: inherit