|
| 1 | +--- |
| 2 | +name: 'Packages Split' |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - v2-unstable-repository-split |
| 8 | + tags: |
| 9 | + - '*' |
| 10 | + |
| 11 | +env: |
| 12 | + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} |
| 13 | + |
| 14 | +jobs: |
| 15 | + sub_packages: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + package: |
| 21 | + - path: 'src/Core' |
| 22 | + remote: 'knplabs/snappy-core' |
| 23 | + - path: 'src/Backend/WkHtmlToPdf' |
| 24 | + remote: 'knplabs/snappy-wkhtmltopdf' |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v2 |
| 27 | + with: |
| 28 | + path: ./monolyth |
| 29 | + - run: mkdir ./readonly |
| 30 | + - name: git clone |
| 31 | + run: | |
| 32 | + cd ./readonly |
| 33 | + git clone -- https://${{ secrets.ACCESS_TOKEN }}@github.com/${{ matrix.package.remote }} . |
| 34 | + git checkout -b main || git branch main |
| 35 | + - name: git fetch |
| 36 | + run: | |
| 37 | + cd ./readonly |
| 38 | + git fetch |
| 39 | + - run: cp --verbose -ra ./monolyth/${{ matrix.package.path }}/* ./readonly |
| 40 | + - run: ls -la ./readonly |
| 41 | + - name: git status |
| 42 | + run: | |
| 43 | + cd ./readonly |
| 44 | + git status |
| 45 | + - name: git add |
| 46 | + run: | |
| 47 | + cd ./readonly |
| 48 | + git add . |
| 49 | + - id: commit_message |
| 50 | + name: commit_message |
| 51 | + run: | |
| 52 | + export "COMMIT_MESSAGE=$(cd ./monolyth; git show -s --format=%B ${GITHUB_SHA})" |
| 53 | + echo "$COMMIT_MESSAGE" |
| 54 | + echo "$COMMIT_MESSAGE" >> $GITHUB_OUTPUT |
| 55 | + - name: git commit |
| 56 | + run: | |
| 57 | + cd ./readonly |
| 58 | + git commit --message `${{ steps.commit_message.output.COMMIT_MESSAGE }}` |
| 59 | + - name: git push |
| 60 | + run: | |
| 61 | + cd ./readonly |
| 62 | + git push --quiet origin main |
| 63 | + - if: "startsWith(github.ref, 'refs/tags/')" |
| 64 | + name: git tag |
| 65 | + run: | |
| 66 | + cd ./readonly |
| 67 | + git tag %s -m "${GITHUB_REF#refs/tags/}" |
| 68 | + git push --quiet origin "${GITHUB_REF#refs/tags/}" |
| 69 | +# - if: "!startsWith(github.ref, 'refs/tags/')" |
| 70 | +# uses: "symplify/[email protected]" |
| 71 | +# with: |
| 72 | +# package_directory: '${{ matrix.package.path }}' |
| 73 | +# repository_organization: 'knplabs' |
| 74 | +# repository_name: '${{ matrix.package.remote }}' |
| 75 | +# user_name: "knpEdgar" |
| 76 | + |
| 77 | +# - if: "startsWith(github.ref, 'refs/tags/')" |
| 78 | +# uses: "symplify/[email protected]" |
| 79 | +# with: |
| 80 | +# tag: ${GITHUB_REF#refs/tags/} |
| 81 | +# package_directory: '${{ matrix.package.path }}' |
| 82 | +# repository_organization: 'knplabs' |
| 83 | +# repository_name: '${{ matrix.package.remote }}' |
| 84 | +# user_name: "knpEdgar" |
| 85 | + |
0 commit comments