Skip to content

Gitsplit #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitsplit.yml export-ignore
/monorepo-builder.php export-ignore
/CODE_OF_CONDUCT.md export-ignore
/deptrac.yaml export-ignore
Expand Down
143 changes: 9 additions & 134 deletions .github/workflows/gitsplit.yml
Original file line number Diff line number Diff line change
@@ -1,143 +1,18 @@
name: gitsplit
on:
push:
branches:
- "*.x"
tags:
- '*'

env:
GITHUB_TOKEN: ${{ secrets.GITSPLIT_TOKEN }}
release:
types: [published]

jobs:
packages_split:
gitsplit:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# define package to repository map
package:
-
local_path: 'src/Component/Core'
split_repository: 'jwt-core'
-
local_path: 'src/Component/Checker'
split_repository: 'jwt-checker'
-
local_path: 'src/Component/Signature'
split_repository: 'jwt-signature'
-
local_path: 'src/Component/Encryption'
split_repository: 'jwt-encryption'
-
local_path: 'src/Component/KeyManagement'
split_repository: 'jwt-key-mgmt'
-
local_path: 'src/Component/Console'
split_repository: 'jwt-console'
-
local_path: 'src/Component/NestedToken'
split_repository: 'jwt-nested-token'
-
local_path: 'src/Bundle/JoseFramework'
split_repository: 'jwt-bundle'
-
local_path: 'src/EncryptionAlgorithm/ContentEncryption/AESCBC'
split_repository: 'jwt-encryption-algorithm-aescbc'
-
local_path: 'src/EncryptionAlgorithm/ContentEncryption/AESGCM'
split_repository: 'jwt-encryption-algorithm-aesgcm'
-
local_path: 'src/EncryptionAlgorithm/KeyEncryption/AESGCMKW'
split_repository: 'jwt-encryption-algorithm-aesgcmkw'
-
local_path: 'src/EncryptionAlgorithm/KeyEncryption/AESKW'
split_repository: 'jwt-encryption-algorithm-aeskw'
-
local_path: 'src/EncryptionAlgorithm/KeyEncryption/Direct'
split_repository: 'jwt-encryption-algorithm-dir'
-
local_path: 'src/EncryptionAlgorithm/KeyEncryption/ECDHES'
split_repository: 'jwt-encryption-algorithm-ecdh-es'
-
local_path: 'src/EncryptionAlgorithm/KeyEncryption/PBES2'
split_repository: 'jwt-encryption-algorithm-pbes2'
-
local_path: 'src/EncryptionAlgorithm/KeyEncryption/RSA'
split_repository: 'jwt-encryption-algorithm-rsa'
-
local_path: 'src/SignatureAlgorithm/ECDSA'
split_repository: 'jwt-signature-algorithm-ecdsa'
-
local_path: 'src/SignatureAlgorithm/EdDSA'
split_repository: 'jwt-signature-algorithm-eddsa'
-
local_path: 'src/SignatureAlgorithm/None'
split_repository: 'jwt-signature-algorithm-none'
-
local_path: 'src/SignatureAlgorithm/HMAC'
split_repository: 'jwt-signature-algorithm-hmac'
-
local_path: 'src/SignatureAlgorithm/RSA'
split_repository: 'jwt-signature-algorithm-rsa'
-
local_path: 'src/SignatureAlgorithm/Experimental'
split_repository: 'jwt-signature-algorithm-experimental'
-
local_path: 'src/EncryptionAlgorithm/Experimental'
split_repository: 'jwt-encryption-algorithm-experimental'
-
local_path: 'src/Ecc'
split_repository: 'jwt-util-ecc'
-
local_path: 'packs/encryption'
split_repository: 'encryption-pack'
-
local_path: 'packs/signature'
split_repository: 'signature-pack'

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# no tag
-
if: "!startsWith(github.ref, 'refs/tags/')"
uses: "symplify/[email protected]"
with:
# ↓ split "src/*" directory
package_directory: '${{ matrix.package.local_path }}'

# ↓ into https://github.com/web-token/* repository
repository_organization: 'web-token'
repository_name: '${{ matrix.package.split_repository }}'

# [optional, with "github.com" as default]
#repository_host: git.private.com:1234

# ↓ the user signed under the split commit
user_name: ${{ secrets.GIT_AUTHOR_NAME }}
user_email: ${{ secrets.GIT_AUTHOR_EMAIL }}

# with tag
-
if: "startsWith(github.ref, 'refs/tags/')"
uses: "symplify/[email protected]"
with:
tag: ${GITHUB_REF#refs/tags/}

# ↓ split "src/*" directory
package_directory: '${{ matrix.package.local_path }}'

# ↓ into https://github.com/web-token/* repository
repository_organization: 'web-token'
repository_name: '${{ matrix.package.split_repository }}'

# [optional, with "github.com" as default]
#repository_host: git.private.com:1234

# ↓ the user signed under the split commit
user_name: ${{ secrets.GIT_AUTHOR_NAME }}
user_email: ${{ secrets.GIT_AUTHOR_EMAIL }}
- name: checkout
run: git clone https://github.com/web-token/jwt-framework /home/runner/work/web-token/jwt-framework && cd /home/runner/work/web-token/jwt-framework
- name: Split repositories
run: docker run --rm -t -e GH_TOKEN -v /cache/gitsplit:/cache/gitsplit -v /home/runner/work/web-token/jwt-framework:/srv jderusse/gitsplit gitsplit
env:
GH_TOKEN: ${{ secrets.GITSPLIT_TOKEN }}
57 changes: 57 additions & 0 deletions .gitsplit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
splits:
- prefix: "src/Component/Core"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-core.git"
- prefix: "src/Component/Checker"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-checker.git"
- prefix: "src/Component/Signature"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature.git"
- prefix: "src/Component/Encryption"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption.git"
- prefix: "src/Component/KeyManagement"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-key-mgmt.git"
- prefix: "src/Component/Console"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-console.git"
- prefix: "src/Component/NestedToken"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-nested-token.git"
- prefix: "src/Bundle/JoseFramework"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-bundle.git"
- prefix: "src/EncryptionAlgorithm/ContentEncryption/AESCBC"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aescbc.git"
- prefix: "src/EncryptionAlgorithm/ContentEncryption/AESGCM"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aesgcm.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/AESGCMKW"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aesgcmkw.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/AESKW"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aeskw.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/Direct"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-dir.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/ECDHES"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-ecdh-es.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/PBES2"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-pbes2.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/RSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-rsa.git"
- prefix: "src/SignatureAlgorithm/ECDSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-ecdsa.git"
- prefix: "src/SignatureAlgorithm/EdDSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-eddsa.git"
- prefix: "src/SignatureAlgorithm/None"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-none.git"
- prefix: "src/SignatureAlgorithm/HMAC"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-hmac.git"
- prefix: "src/SignatureAlgorithm/RSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-rsa.git"
- prefix: "src/SignatureAlgorithm/Experimental"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-experimental.git"
- prefix: "src/EncryptionAlgorithm/Experimental"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-experimental.git"
- prefix: "src/Ecc"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-util-ecc.git"
- prefix: "packs/encryption"
target: "https://${GH_TOKEN}@github.com/web-token/encryption-pack.git"
- prefix: "packs/signature"
target: "https://${GH_TOKEN}@github.com/web-token/signature-pack.git"

origins:
- ^\d+\.\d+\.x$
- ^\d+\.\d+\.\d+$