From dfa214c5f07370798a6eeaab1f01ce2c6c56b36d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20G=C3=BCell=20Segarra?= Date: Mon, 4 Dec 2023 16:33:07 +0100 Subject: [PATCH] chore: update workflow --- .../create_dependencies_alpha_pr.yaml | 42 ------------------- .../update_dependent_projects_alpha.yaml | 29 +++++++++++++ 2 files changed, 29 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/create_dependencies_alpha_pr.yaml create mode 100644 .github/workflows/update_dependent_projects_alpha.yaml diff --git a/.github/workflows/create_dependencies_alpha_pr.yaml b/.github/workflows/create_dependencies_alpha_pr.yaml deleted file mode 100644 index 424b5a5..0000000 --- a/.github/workflows/create_dependencies_alpha_pr.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: ALPHA - Create PR on dependencies of this library - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - create-pr: - if: github.event.release.prerelease == true && contains(github.event.release.tag_name, '-alpha.') - runs-on: ubuntu-latest - - steps: - - name: Checkout webclient repository - uses: actions/checkout@v2 - with: - repository: "gisce/react-ooui" - ref: alpha - token: ${{ secrets.GH_PAT }} - - - name: Update library version in package.json - run: | - NEW_VERSION=${{ github.event.release.tag_name }} - NEW_VERSION=${NEW_VERSION#v} # Remove the leading 'v' - sed -i 's|"@gisce/react-formiga-table": "[^"]*"|"@gisce/react-formiga-table": "'"$NEW_VERSION"'"|' package.json - - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: "20.5.0" - - - name: Install npm dependencies and generate package-lock.json - run: | - npm install - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GH_PAT }} - commit-message: "fix: Update @gisce/react-formiga-table to ${{ github.event.release.tag_name }}" - title: "Update @gisce/react-formiga-table to ${{ github.event.release.tag_name }}" - branch: "update-react-formiga-table-${{ github.event.release.tag_name }}" diff --git a/.github/workflows/update_dependent_projects_alpha.yaml b/.github/workflows/update_dependent_projects_alpha.yaml new file mode 100644 index 0000000..8ed8bb5 --- /dev/null +++ b/.github/workflows/update_dependent_projects_alpha.yaml @@ -0,0 +1,29 @@ +name: Update dependent projects (ALPHA) + +on: + release: + types: [published] + workflow_dispatch: + +env: + LIBRARY_NAME: "gisce/react-formiga-table" + BRANCH_NAME: "alpha" + +jobs: + update-dependents: + if: github.event.release.prerelease == false && !contains(github.event.release.tag_name, '-alpha.') && !contains(github.event.release.tag_name, '-rc.') + runs-on: ubuntu-latest + strategy: + matrix: + include: + - project: "gisce/react-ooui" + branch: ${{ env.BRANCH_NAME }} + steps: + - name: Call Reusable Workflow for each project + uses: gisce/create-update-version-pr@v0.0.5 + with: + dependentProject: ${{ matrix.project }} + tagName: ${{ github.event.release.tag_name }} + dependentProjectBranch: ${{ matrix.branch }} + libraryName: ${{ env.LIBRARY_NAME }} + githubToken: ${{ secrets.GH_PAT }}