mirror of
https://github.com/sp-tarkov/build.git
synced 2025-02-12 14:50:44 -05:00
Enables Workflow Dispatch
You can now trigger builds from the GH UI
This commit is contained in:
parent
3e2b955d54
commit
159c260bbb
33
.github/workflows/build.yaml
vendored
33
.github/workflows/build.yaml
vendored
@ -5,6 +5,12 @@ on:
|
||||
- cron: "0 17 * * *"
|
||||
repository_dispatch:
|
||||
types: [build-trigger]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
buildTag:
|
||||
description: "The tag to build on"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
@ -33,6 +39,7 @@ jobs:
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
CLIENT_PAYLOAD_TAG: ${{ github.event.client_payload.tag }}
|
||||
WORKFLOW_INPUT_TAG: ${{ github.event.inputs.buildTag }}
|
||||
run: |
|
||||
echo "Determining build context..."
|
||||
if [[ "$EVENT_NAME" == "schedule" ]]; then
|
||||
@ -42,25 +49,23 @@ jobs:
|
||||
echo "branch_launcher=3.10.0-DEV" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "is_nightly=false" >> $GITHUB_OUTPUT
|
||||
if [[ -z "$CLIENT_PAYLOAD_TAG" ]]; then
|
||||
# Determine the tag based on the event type
|
||||
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
|
||||
TAG_NAME="$WORKFLOW_INPUT_TAG"
|
||||
elif [[ "$EVENT_NAME" == "repository_dispatch" ]]; then
|
||||
TAG_NAME="$CLIENT_PAYLOAD_TAG"
|
||||
else
|
||||
echo "Unsupported event: $EVENT_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "$TAG_NAME" ]]; then
|
||||
echo "No tag provided in event payload."
|
||||
exit 1
|
||||
fi
|
||||
echo "target_tag=$CLIENT_PAYLOAD_TAG" >> $GITHUB_OUTPUT
|
||||
echo "target_tag=$TAG_NAME" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Determine Target Tag
|
||||
id: determine-target-tag
|
||||
if: steps.determine-context.outputs.is_nightly == 'false'
|
||||
shell: bash
|
||||
run: |
|
||||
TAG_NAME="${{ github.event.client_payload.tag }}"
|
||||
if [[ -z "$TAG_NAME" ]]; then
|
||||
echo "No tag provided in event payload."
|
||||
exit 1
|
||||
fi
|
||||
echo "target_tag=$TAG_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Determine Build Type
|
||||
id: determine-build-type
|
||||
shell: bash
|
||||
|
Loading…
x
Reference in New Issue
Block a user