Skip to content

Commit

Permalink
ci: try to split main repository into sub repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroTroller committed Jun 23, 2023
1 parent 450b77c commit e380894
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[safe]
directory = "*"
82 changes: 0 additions & 82 deletions .github/workflows/build.yaml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/split.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
name: 'Packages Split'

on:
push:
branches:
- v2-unstable-repository-split
tags:
- '*'

env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

jobs:
sub_packages:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- path: 'src/Core'
remote: 'knplabs/snappy-core'
- path: 'src/Backend/WkHtmlToPdf'
remote: 'knplabs/snappy-wkhtmltopdf'
steps:
- uses: actions/checkout@v2
with:
path: ./monolyth
- run: mkdir ./readonly
- name: git clone
run: |
cd ./readonly
git clone -- https://${{ secrets.ACCESS_TOKEN }}@github.com/${{ matrix.package.remote }} .
git checkout -b main || git branch main
- name: git fetch
run: |
cd ./readonly
git fetch
- run: cp --verbose -ra ./monolyth/${{ matrix.package.path }}/* ./readonly
- run: ls -la ./readonly
- name: git status
run: |
cd ./readonly
git status
- name: git add
run: |
cd ./readonly
git add .
- id: commit_message
name: commit_message
run: |
echo "COMMIT_MESSAGE=$(cd ./monolyth; git show -s --format=%B ${GITHUB_SHA})"
export "COMMIT_MESSAGE=$(cd ./monolyth; git show -s --format=%B ${GITHUB_SHA})" >> $GITHUB_OUTPUT
- name: git commit
run: |
cd ./readonly
git commit --message `${{ steps.commit_message.output.COMMIT_MESSAGE }}`
- name: git push
run: |
cd ./readonly
git push --quiet origin main
- if: "startsWith(github.ref, 'refs/tags/')"
name: git tag
run: |
cd ./readonly
git tag %s -m "${GITHUB_REF#refs/tags/}"
git push --quiet origin "${GITHUB_REF#refs/tags/}"
# - if: "!startsWith(github.ref, 'refs/tags/')"
# uses: "symplify/[email protected]"
# with:
# package_directory: '${{ matrix.package.path }}'
# repository_organization: 'knplabs'
# repository_name: '${{ matrix.package.remote }}'
# user_name: "knpEdgar"
# user_email: "[email protected]"
# - if: "startsWith(github.ref, 'refs/tags/')"
# uses: "symplify/[email protected]"
# with:
# tag: ${GITHUB_REF#refs/tags/}
# package_directory: '${{ matrix.package.path }}'
# repository_organization: 'knplabs'
# repository_name: '${{ matrix.package.remote }}'
# user_name: "knpEdgar"
# user_email: "[email protected]"
1 change: 1 addition & 0 deletions src/Core/FileToPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

interface FileToPdf
{

public function generate(SplFileInfo $file, ArrayAccess|array $options = []): StreamInterface;
}

0 comments on commit e380894

Please sign in to comment.