diff --git a/.github/workflows/create_webclient_beta_pr.yaml b/.github/workflows/create_webclient_beta_pr.yaml new file mode 100644 index 000000000..db837d44b --- /dev/null +++ b/.github/workflows/create_webclient_beta_pr.yaml @@ -0,0 +1,36 @@ +name: Create PR on WebClient on Alpha Prerelease + +on: + release: + types: [published] + +jobs: + create-pr: + env: + TARGET_BRANCH: develop # This sets the variable for the branch + if: github.event.release.prerelease == true && startsWith(github.event.release.tag_name, 'v') && contains(github.event.release.tag_name, '-beta.') + runs-on: ubuntu-latest + + steps: + - name: Checkout webclient repository + uses: actions/checkout@v2 + with: + repository: '@gisce/webclient' + ref: ${{ env.TARGET_BRANCH }} + token: ${{ secrets.GH_PAT }} + + - name: Update library version in package.json + run: | + sed -i 's/"@gisce/react-ooui": "[^"]*"/"@gisce/react-ooui": "${{ github.event.release.tag_name }}"/' package.json + + - 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: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}" + title: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}" + branch: "update-react-ooui-${{ github.event.release.tag_name }}" diff --git a/.github/workflows/create_webclient_release_pr.yaml b/.github/workflows/create_webclient_release_pr.yaml new file mode 100644 index 000000000..7512209f9 --- /dev/null +++ b/.github/workflows/create_webclient_release_pr.yaml @@ -0,0 +1,36 @@ +name: Create PR on WebClient on Alpha Prerelease + +on: + release: + types: [published] + +jobs: + create-pr: + env: + TARGET_BRANCH: alpha # This sets the variable for the branch + if: github.event.release.prerelease == false + runs-on: ubuntu-latest + + steps: + - name: Checkout webclient repository + uses: actions/checkout@v2 + with: + repository: '@gisce/webclient' + ref: ${{ env.TARGET_BRANCH }} + token: ${{ secrets.GH_PAT }} + + - name: Update library version in package.json + run: | + sed -i 's/"@gisce/react-ooui": "[^"]*"/"@gisce/react-ooui": "${{ github.event.release.tag_name }}"/' package.json + + - 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: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}" + title: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}" + branch: "update-react-ooui-${{ github.event.release.tag_name }}"