From 70635bc7a334574b7e563e3233e46a368e5b147e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alois=20Ja=C5=A1a?= Date: Mon, 1 Apr 2024 15:45:00 +0200 Subject: [PATCH 1/2] =?UTF-8?q?peckadesign/p7packages#217=20-=20Pro=20ov?= =?UTF-8?q?=C4=9B=C5=99en=C3=AD=20composer=20validate=20nen=C3=AD=20pot?= =?UTF-8?q?=C5=99eba=20composer=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/composer-validate.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/composer-validate.yaml b/.github/workflows/composer-validate.yaml index 421b0f9..dc8d865 100644 --- a/.github/workflows/composer-validate.yaml +++ b/.github/workflows/composer-validate.yaml @@ -45,5 +45,4 @@ jobs: - name: Composer validate if: env.GIT_DIFF && env.MATCHED_FILES run: | - composer install --no-progress composer validate From 9c3071076fffdfe2d813cf131f5cdf195960b981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alois=20Ja=C5=A1a?= Date: Mon, 1 Apr 2024 15:58:57 +0200 Subject: [PATCH 2/2] =?UTF-8?q?peckadesign/p7packages#146=20-=20P=C5=99i?= =?UTF-8?q?=20splitov=C3=A1n=C3=AD=20se=20tagy=20pushuj=C3=AD=20jen=20pro?= =?UTF-8?q?=20v*=20v=C4=9Btve=20(ne=20master/main),=20-=20split-repositori?= =?UTF-8?q?es.sh=20m=C3=A1=20voliteln=C3=A9=20pushov=C3=A1n=C3=AD=20tag?= =?UTF-8?q?=C5=AF,=20-=20monorepo=5Frelease=20um=C3=AD=20rozpoznat=20"stag?= =?UTF-8?q?e"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/split-monorepo/action.yaml | 6 +++++- .../actions/split-monorepo/split-repositories.sh | 9 ++++++--- .github/workflows/monorepo_release.yml | 15 ++++++++++++++- .github/workflows/split_monorepo.yaml | 6 ++++++ .../p7-monorepo-split-with-dispatch.yaml | 1 + workflow-templates/p7-monorepo-split.yaml | 1 + 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/actions/split-monorepo/action.yaml b/.github/actions/split-monorepo/action.yaml index 3d05f44..046c158 100644 --- a/.github/actions/split-monorepo/action.yaml +++ b/.github/actions/split-monorepo/action.yaml @@ -12,6 +12,10 @@ inputs: description: 'Force push' required: false default: 'false' + push-tags: + description: 'Push tags' + required: false + default: 'false' gh-token: required: true description: "GitHub token" @@ -28,4 +32,4 @@ runs: shell: "bash" run: | git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | xargs -L1 git config --unset-all - bash ${{github.action_path}}/split-repositories.sh "${{ inputs.gh-token }}" "${{ inputs.package }}" ${{ inputs.organization }} "${{ github.ref_name }}" ${{ inputs.force == 'true' }} + bash ${{github.action_path}}/split-repositories.sh "${{ inputs.gh-token }}" "${{ inputs.package }}" ${{ inputs.organization }} "${{ github.ref_name }}" ${{ inputs.force == 'true' }} ${{ inputs.push-tags == 'true' }} diff --git a/.github/actions/split-monorepo/split-repositories.sh b/.github/actions/split-monorepo/split-repositories.sh index 3f80b4a..d9c8e7f 100644 --- a/.github/actions/split-monorepo/split-repositories.sh +++ b/.github/actions/split-monorepo/split-repositories.sh @@ -7,6 +7,7 @@ PACKAGE=$2 ORGANIZATION=$3 BRANCH=$4 FORCE=${5:-false} +PUSH_TAG=${6:-false} TMP="tmp_split/${RANDOM}" URL="https://${GH_TOKEN}@github.com/${ORGANIZATION}/${PACKAGE}" @@ -19,10 +20,12 @@ echo "Monorepo Split – ${PACKAGE}" echo "Init environment" +PUSH_OPTS="" if [[ "$FORCE" == true ]]; then - PUSH_OPTS="--force" -else - PUSH_OPTS="--tags" + PUSH_OPTS="${PUSH_OPTS} --force" +fi +if [[ "$PUSH_TAG" == true ]]; then + PUSH_OPTS="${PUSH_OPTS} --tags" fi cd ${DIR_PWD} diff --git a/.github/workflows/monorepo_release.yml b/.github/workflows/monorepo_release.yml index 7391db0..1f1b348 100644 --- a/.github/workflows/monorepo_release.yml +++ b/.github/workflows/monorepo_release.yml @@ -1,4 +1,5 @@ name: Monorepo release +run-name: Monorepo release - ${{ inputs.version }} version on: workflow_dispatch: @@ -55,5 +56,17 @@ jobs: - name: Composer uses: ramsey/composer-install@v2 + - name: Stage Check + id: stage + shell: bash + run: | + if [ "${{ inputs.version }}" == 'patch' ]; then + echo "stage=patch" >> $GITHUB_OUTPUT; + elif [ "${{ inputs.version }}" == 'minor' ]; then + echo "stage=release" >> $GITHUB_OUTPUT; + elif [ "${{ inputs.version }}" == 'major' ]; then + echo "stage=release" >> $GITHUB_OUTPUT; + fi + - name: Release - run: vendor/bin/monorepo-builder release ${{ inputs.version }} + run: vendor/bin/monorepo-builder release ${{ inputs.version }} --stage ${{ steps.stage.outputs.stage}} diff --git a/.github/workflows/split_monorepo.yaml b/.github/workflows/split_monorepo.yaml index 3ec1ea6..b8e5d5e 100644 --- a/.github/workflows/split_monorepo.yaml +++ b/.github/workflows/split_monorepo.yaml @@ -17,6 +17,11 @@ on: required: false type: boolean default: false + push-tags: + description: 'push tags' + required: false + type: boolean + default: false secrets: gh-token: required: true @@ -64,4 +69,5 @@ jobs: organization: ${{ inputs.organization }} package: ${{ inputs.package }} force: ${{ inputs.force }} + push-tags: ${{ inputs.push-tags }} gh-token: ${{ secrets.gh-token }} diff --git a/workflow-templates/p7-monorepo-split-with-dispatch.yaml b/workflow-templates/p7-monorepo-split-with-dispatch.yaml index d3436c3..dac8d36 100644 --- a/workflow-templates/p7-monorepo-split-with-dispatch.yaml +++ b/workflow-templates/p7-monorepo-split-with-dispatch.yaml @@ -30,5 +30,6 @@ jobs: package: ${{ matrix.package }} organization: "peckadesign" force: ${{ inputs.force == 'true' }} + push-tags: ${{ github.ref != 'refs/heads/master' }} secrets: gh-token: # GITHUB Token diff --git a/workflow-templates/p7-monorepo-split.yaml b/workflow-templates/p7-monorepo-split.yaml index ee8eb8a..721d2c3 100644 --- a/workflow-templates/p7-monorepo-split.yaml +++ b/workflow-templates/p7-monorepo-split.yaml @@ -24,5 +24,6 @@ jobs: with: package: ${{ matrix.package }} organization: "peckadesign" + push-tags: ${{ github.ref != 'refs/heads/master' }} secrets: gh-token: # GITHUB Token