surrealpatch/.github/workflows/beta.yml

54 lines
1.2 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
2023-12-11 13:58:43 +00:00
run-name: "Beta release (publish: ${{ inputs.publish }})"
on:
workflow_dispatch:
inputs:
publish:
required: false
type: boolean
default: false
description: "Publish the beta release"
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 }}
publish: ${{ inputs.publish }}
create-release: ${{ inputs.publish }}
secrets: inherit