From d07da22bbffd77085526f4015d11c1c6cc8708e3 Mon Sep 17 00:00:00 2001 From: okx-code Date: Thu, 21 Mar 2024 19:49:10 +0000 Subject: [PATCH] Revert "Remove manual dispatches" This reverts commit dde88f9bd938cfb7788658f472393f620915037f. --- .github/workflows/check_gradle_all.yaml | 1 + .github/workflows/lint_yaml.yaml | 1 + .github/workflows/publish_container.yaml | 31 ++++++++++++++++--- .github/workflows/publish_gradle_project.yaml | 28 ++++++++++++++--- 4 files changed, 53 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check_gradle_all.yaml b/.github/workflows/check_gradle_all.yaml index c034fc2b0..1f3c2fa73 100644 --- a/.github/workflows/check_gradle_all.yaml +++ b/.github/workflows/check_gradle_all.yaml @@ -2,6 +2,7 @@ name: 🐘 Gradle | Check All on: + workflow_dispatch: pull_request: types: [ opened, synchronize, reopened ] diff --git a/.github/workflows/lint_yaml.yaml b/.github/workflows/lint_yaml.yaml index 870fa475c..7cf58a5ce 100644 --- a/.github/workflows/lint_yaml.yaml +++ b/.github/workflows/lint_yaml.yaml @@ -2,6 +2,7 @@ name: 🔎 Lint Yaml on: + workflow_dispatch: pull_request: types: [ opened, synchronize, reopened ] diff --git a/.github/workflows/publish_container.yaml b/.github/workflows/publish_container.yaml index 545f69051..0fad7cf37 100644 --- a/.github/workflows/publish_container.yaml +++ b/.github/workflows/publish_container.yaml @@ -2,11 +2,31 @@ name: 🐋 Container | Publish on: + workflow_dispatch: + inputs: + project: + required: true + description: 'The container to publish' + type: string + version: + required: true + description: 'The version to release' + type: string + category: + required: true + description: 'The category of project' + type: choice + options: + - containers push: tags: - 'containers/*/v*.*.*' jobs: + # This job either uses the inputs from the workflow_dispatch event, + # or will split values out of the pushed tag. + # This allows the release manager to either create a release themselves and have this job pick it up, + # Or run this job to create a release. determine_values: name: 🔎 Determine Values runs-on: ubuntu-latest @@ -20,18 +40,21 @@ jobs: - name: 🔎 Determine Project Values id: determine_values env: + CATEGORY_OVERRIDE: ${{ inputs.category }} + PROJECT_OVERRIDE: ${{ inputs.project }} + VERSION_OVERRIDE: ${{ inputs.version }} TAG: ${{ github.ref_name }} run: | - category=${TAG%%/*} + category=${CATEGORY_OVERRIDE:-${TAG%%/*}} echo "category=${category}" echo "category=${category}" >> $GITHUB_OUTPUT - version=${TAG##*/} + version=${VERSION_OVERRIDE:-${TAG##*/}} echo "version=${version}" echo "version=${version}" >> $GITHUB_OUTPUT - project=${TAG#*/} - project=${project%/*} + project=${PROJECT_OVERRIDE:-${TAG#*/}} + project=${PROJECT_OVERRIDE:-${project%/*}} echo "project=${project}" echo "project=${project}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/publish_gradle_project.yaml b/.github/workflows/publish_gradle_project.yaml index b7c0f8693..33afc4b38 100644 --- a/.github/workflows/publish_gradle_project.yaml +++ b/.github/workflows/publish_gradle_project.yaml @@ -3,11 +3,31 @@ name: 🐘 Gradle | Publish Project on: + workflow_dispatch: + inputs: + category: + required: true + description: 'The category of project' + type: choice + options: + - plugins + project: + required: true + description: 'The project to build' + type: string + version: + required: true + description: 'The version to release' + type: string push: tags: - 'plugins/*/v*.*.*' jobs: + # This job either uses the inputs from the workflow_dispatch event, + # or will split values out of the pushed tag. + # This allows the release manager to either create a release themselves and have this job pick it up, + # Or run this job to create a release. determine_values: name: 🔎 Determine Values runs-on: ubuntu-latest @@ -23,16 +43,16 @@ jobs: env: TAG: ${{ github.ref_name }} run: | - category=${TAG%%/*} + category=${CATEGORY_OVERRIDE:-${TAG%%/*}} echo "category=${category}" echo "category=${category}" >> $GITHUB_OUTPUT - version=${TAG##*/} + version=${VERSION_OVERRIDE:-${TAG##*/}} echo "version=${version}" echo "version=${version}" >> $GITHUB_OUTPUT - project=${TAG#*/} - project=${project%/*} + project=${PROJECT_OVERRIDE:-${TAG#*/}} + project=${PROJECT_OVERRIDE:-${project%/*}} echo "project=${project}" echo "project=${project}" >> $GITHUB_OUTPUT