diff --git a/.github/workflows/api_platform.yml b/.github/workflows/api_platform.yml deleted file mode 100644 index 7390df9b74c..00000000000 --- a/.github/workflows/api_platform.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Distribution update - -on: - push: - tags: - workflow_dispatch: ~ - -env: - GH_TOKEN: ${{ github.token }} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - run-api-platform-workflow: - runs-on: ubuntu-latest - steps: - - name: Update distribution - run: gh workflow run -R api-platform/api-platform release.yml -f tag=${{ github.ref_name }} - - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..56699219aec --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,63 @@ +name: Release Pipeline + +on: + push: + tags: + - 'v*' + branches: + - main + - '[0-9].*' + - '[0-9][0-9].*' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + split: + name: Subtree Split + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Generate App Token + id: generate_token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.API_PLATFORM_APP_ID }} + private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }} + + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ steps.generate_token.outputs.token }} + fetch-depth: 0 + + - name: Install splitsh + run: | + curl -L https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz > lite_linux_amd64.tar.gz + tar -zxpf lite_linux_amd64.tar.gz + chmod +x splitsh-lite + echo "$(pwd)" >> $GITHUB_PATH + + - name: Split to manyrepo + run: find src -maxdepth 3 -name composer.json -print0 | xargs -I '{}' -n 1 -0 bash subtree.sh {} ${{ github.ref }} + + dispatch-distribution-update: + name: Dispatch Distribution Update + runs-on: ubuntu-latest + needs: split + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Generate App Token + id: generate_token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.API_PLATFORM_APP_ID }} + private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }} + + - name: Update distribution + env: + GH_TOKEN: ${{ steps.generate_token.outputs.token }} + run: gh workflow run -R api-platform/api-platform release.yml -f tag=${{ github.ref_name }} diff --git a/.github/workflows/subtree.yml b/.github/workflows/subtree.yml deleted file mode 100644 index 8ecb7ce534d..00000000000 --- a/.github/workflows/subtree.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: subtree -on: - push: - tags: - - v* - branches: - - main - - '3.1' - - '3.2' - - '3.3' - - '3.4' - - '4.0' - - '4.1' - -env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - split: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.GH_TOKEN }} - - name: 'Install splitsh' - run: | - curl -L https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz > lite_linux_amd64.tar.gz - tar -zxpf lite_linux_amd64.tar.gz - chmod +x splitsh-lite - echo "$(pwd)" >> $GITHUB_PATH - - name: 'Split to manyrepo' - run: find src -maxdepth 3 -name composer.json -print0 | xargs -I '{}' -n 1 -0 bash subtree.sh {} ${{ github.ref }}