From d6a1399e356b7f5b26c25092235d727816f7f6c2 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Wed, 4 Oct 2023 15:03:36 +0200 Subject: [PATCH] ci: Adds call of build-docker-from-tag.yml from release-please. (#153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What ❔ Adds call of build-docker-from-tag.yml from release-please. Allows manually call of build-docker-from-tag.yml. ## Why ❔ To create releases due to issue in github which doesn't allow automatic workflow triggers from workflow. ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. --- .github/workflows/build-docker-from-tag.yml | 21 +++++++++++++++++++-- .github/workflows/release-please.yml | 4 ++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-from-tag.yml b/.github/workflows/build-docker-from-tag.yml index 95f6e5998bc1..d499a7afaada 100644 --- a/.github/workflows/build-docker-from-tag.yml +++ b/.github/workflows/build-docker-from-tag.yml @@ -1,5 +1,17 @@ name: Build Image from tag on: + workflow_call: + inputs: + tag_name: + description: "Tag of an image to built" + type: string + required: true + workflow_dispatch: + inputs: + tag_name: + description: "Tag of an image to built" + type: string + required: true push: tags: - core-v** @@ -10,7 +22,7 @@ concurrency: docker-build jobs: setup: name: Setup - runs-on: [k8s, stage] + runs-on: [ubuntu-latest] outputs: image_tag_suffix: ${{ steps.set.outputs.image_tag_suffix }} steps: @@ -21,7 +33,12 @@ jobs: - name: Generate output with git tag id: set run: | - git_tag="${GITHUB_REF#refs/*/}" + git_tag="" + if [[ -z "${{ inputs.tag_name }}" ]]; then + git_tag="${GITHUB_REF#refs/*/}" + else + git_tag="${{ inputs.tag_name }}" + fi version=$(cut -d "-" -f2 <<< ${git_tag}) echo "image_tag_suffix=${version}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index d9f04a40e9d4..1194864aa80b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -3,6 +3,10 @@ on: branches: - main +permissions: + contents: write + pull-requests: write + name: release-please jobs: release-please: