|
4 | 4 | types: [published]
|
5 | 5 |
|
6 | 6 | jobs:
|
7 |
| - split-hook-dd-trace: |
| 7 | + split-repositories: |
8 | 8 | runs-on: ubuntu-latest
|
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + # Structure of the config tuple is: |
| 12 | + # 0: Type of package (e.g. open-feature/flagd-*provider*) |
| 13 | + # 1: Name of package (sans-org-prefix e.g. open-feature/*flagd*-provider) |
| 14 | + # 2: Name of subdirectory (e.g. providers/*Flagd*) |
| 15 | + config: |
| 16 | + - [hook, dd-trace, DDTrace] |
| 17 | + - [hook, otel, OpenTelemetry] |
| 18 | + - [hook, validator, Validators] |
| 19 | + - [provider, cloudbees, CloudBees] |
| 20 | + - [provider, flagd, Flagd] |
| 21 | + - [provider, split, Split] |
| 22 | + - [provider, go-feature-flag, GoFeatureFlag] |
9 | 23 | steps:
|
10 | 24 | - name: checkout
|
11 |
| - run: git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout "$GITHUB_SHA" |
12 |
| - - name: push-hook-dd-trace |
13 |
| - uses: tcarrio/git-filter-repo-docker-action@v1 |
| 25 | + run: | |
| 26 | + git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" |
| 27 | + cd "$GITHUB_WORKSPACE" |
| 28 | + git checkout "$GITHUB_SHA" |
| 29 | + - name: Replace string in GitHub Actions |
| 30 | + id: targetRef |
| 31 | + run: | |
| 32 | + input_ref="${{ github.event.release.tag_name }}" |
| 33 | + if [ -n "$input_ref" ]; then |
| 34 | + input_ref="refs/tags/$input_ref" |
| 35 | + target_ref="$(echo -n "$input_ref"|sed 's#open-feature/${{ matrix.config[1] }}-${{ matrix.config[0] }}-##')" |
| 36 | + fi |
| 37 | + echo "::set-output name=result::${target_ref}" |
| 38 | + - name: filter-and-push-package-${{ matrix.config[1] }}-${{ matrix.config[0] }} |
| 39 | + |
14 | 40 | with:
|
15 | 41 | privateKey: ${{ secrets.SSH_PRIVATE_KEY }}
|
16 | 42 | targetOrg: open-feature-php
|
17 |
| - targetRepo: dd-trace-hook |
18 |
| - targetBranch: refs/tags/${{ github.event.release.tag_name }} |
19 |
| - filterArguments: '--subdirectory-filter hooks/DDTrace/ --force' |
20 |
| - |
21 |
| - split-hook-otel: |
22 |
| - runs-on: ubuntu-latest |
23 |
| - steps: |
24 |
| - - name: checkout |
25 |
| - run: git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout "$GITHUB_SHA" |
26 |
| - - name: push-hook-otel |
27 |
| - uses: tcarrio/git-filter-repo-docker-action@v1 |
28 |
| - with: |
29 |
| - privateKey: ${{ secrets.SSH_PRIVATE_KEY }} |
30 |
| - targetOrg: open-feature-php |
31 |
| - targetRepo: otel-hook |
32 |
| - targetBranch: refs/tags/${{ github.event.release.tag_name }} |
33 |
| - filterArguments: '--subdirectory-filter hooks/OpenTelemetry/ --force' |
34 |
| - |
35 |
| - split-hook-validator: |
36 |
| - runs-on: ubuntu-latest |
37 |
| - steps: |
38 |
| - - name: checkout |
39 |
| - run: git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout "$GITHUB_SHA" |
40 |
| - - name: push-hook-validator |
41 |
| - uses: tcarrio/git-filter-repo-docker-action@v1 |
42 |
| - with: |
43 |
| - privateKey: ${{ secrets.SSH_PRIVATE_KEY }} |
44 |
| - targetOrg: open-feature-php |
45 |
| - targetRepo: validators-hook |
46 |
| - targetBranch: refs/tags/${{ github.event.release.tag_name }} |
47 |
| - filterArguments: '--subdirectory-filter hooks/Validators/ --force' |
48 |
| - |
49 |
| - split-provider-cloudbees: |
50 |
| - runs-on: ubuntu-latest |
51 |
| - steps: |
52 |
| - - name: checkout |
53 |
| - run: git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout "$GITHUB_SHA" |
54 |
| - - name: push-provider-cloudbees |
55 |
| - uses: tcarrio/git-filter-repo-docker-action@v1 |
56 |
| - with: |
57 |
| - privateKey: ${{ secrets.SSH_PRIVATE_KEY }} |
58 |
| - targetOrg: open-feature-php |
59 |
| - targetRepo: cloudbees-provider |
60 |
| - targetBranch: refs/tags/${{ github.event.release.tag_name }} |
61 |
| - filterArguments: '--subdirectory-filter providers/CloudBees/ --force' |
62 |
| - |
63 |
| - split-provider-flagd: |
64 |
| - runs-on: ubuntu-latest |
65 |
| - steps: |
66 |
| - - name: checkout |
67 |
| - run: git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout "$GITHUB_SHA" |
68 |
| - - name: push-provider-flagd |
69 |
| - uses: tcarrio/git-filter-repo-docker-action@v1 |
70 |
| - with: |
71 |
| - privateKey: ${{ secrets.SSH_PRIVATE_KEY }} |
72 |
| - targetOrg: open-feature-php |
73 |
| - targetRepo: flagd-provider |
74 |
| - targetBranch: refs/tags/${{ github.event.release.tag_name }} |
75 |
| - filterArguments: '--subdirectory-filter providers/Flagd/ --force' |
76 |
| - |
77 |
| - split-provider-split: |
78 |
| - runs-on: ubuntu-latest |
79 |
| - steps: |
80 |
| - - name: checkout |
81 |
| - run: git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout "$GITHUB_SHA" |
82 |
| - - name: push-provider-split |
83 |
| - uses: tcarrio/git-filter-repo-docker-action@v1 |
84 |
| - with: |
85 |
| - privateKey: ${{ secrets.SSH_PRIVATE_KEY }} |
86 |
| - targetOrg: open-feature-php |
87 |
| - targetRepo: split-provider |
88 |
| - targetBranch: refs/tags/${{ github.event.release.tag_name }} |
89 |
| - filterArguments: '--subdirectory-filter providers/Split/ --force' |
90 |
| - |
91 |
| - split-provider-go-feature-flag: |
92 |
| - runs-on: ubuntu-latest |
93 |
| - steps: |
94 |
| - - name: checkout |
95 |
| - run: git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout "$GITHUB_SHA" |
96 |
| - - name: push-provider-split |
97 |
| - uses: tcarrio/git-filter-repo-docker-action@v1 |
98 |
| - with: |
99 |
| - privateKey: ${{ secrets.SSH_PRIVATE_KEY }} |
100 |
| - targetOrg: open-feature-php |
101 |
| - targetRepo: go-feature-flag-provider |
102 |
| - targetBranch: refs/tags/${{ github.event.release.tag_name }} |
103 |
| - filterArguments: '--subdirectory-filter providers/GoFeatureFlag/ --force' |
| 43 | + targetRepo: ${{ matrix.config[1] }}-${{ matrix.config[0] }} |
| 44 | + targetBranch: ${{ steps.targetRef.outputs.result }} |
| 45 | + tagFilter: ^open-feature/${{ matrix.config[1] }}- |
| 46 | + filterArguments: | |
| 47 | + --subdirectory-filter "${{matrix.config[0] }}s/${{ matrix.config[2] }}/" \ |
| 48 | + --tag-rename "open-feature/${{ matrix.config[1] }}-${{ matrix.config[0] }}-:" \ |
| 49 | + --force |
0 commit comments