|
| 1 | +name: Files sync |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | +jobs: |
| 7 | + sync-files: |
| 8 | + if: github.repository == 'micronaut-projects/micronaut-project-template' |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + max-parallel: 3 |
| 13 | + matrix: |
| 14 | + repo: |
| 15 | + - acme |
| 16 | + - aot |
| 17 | + - aws |
| 18 | + - azure |
| 19 | + - cache |
| 20 | + - cassandra |
| 21 | + - chatbots |
| 22 | + - coherence |
| 23 | + - core |
| 24 | + - couchbase |
| 25 | + - data |
| 26 | + - discovery-client |
| 27 | + - elasticsearch |
| 28 | + - email |
| 29 | + - flyway |
| 30 | + - gcp |
| 31 | + - graphql |
| 32 | + - groovy |
| 33 | + - grpc |
| 34 | + - hibernate-validator |
| 35 | + - ignite |
| 36 | + - jackson-xml |
| 37 | + - jaxrs |
| 38 | + - jms |
| 39 | + - jmx |
| 40 | + - kafka |
| 41 | + - kotlin |
| 42 | + - kubernetes |
| 43 | + - liquibase |
| 44 | + - micrometer |
| 45 | + - microstream |
| 46 | + - mongodb |
| 47 | + - mqtt |
| 48 | + - multitenancy |
| 49 | + - nats |
| 50 | + - neo4j |
| 51 | + - openapi |
| 52 | + - oracle-cloud |
| 53 | + - picocli |
| 54 | + - problem-json |
| 55 | + - pulsar |
| 56 | + - r2dbc |
| 57 | + - rabbitmq |
| 58 | + - reactor |
| 59 | + - redis |
| 60 | + - rss |
| 61 | + - rxjava2 |
| 62 | + - rxjava3 |
| 63 | + - security |
| 64 | + - serialization |
| 65 | + - servlet |
| 66 | + - spring |
| 67 | + - sql |
| 68 | + - test |
| 69 | + - toml |
| 70 | + - tracing |
| 71 | + - views |
| 72 | + steps: |
| 73 | + - name: Checkout source |
| 74 | + uses: actions/checkout@v3 |
| 75 | + with: |
| 76 | + path: source |
| 77 | + - name: Checkout target - default branch |
| 78 | + uses: actions/checkout@v3 |
| 79 | + with: |
| 80 | + repository: micronaut-projects/micronaut-${{ matrix.repo }} |
| 81 | + path: target |
| 82 | + fetch-depth: 0 |
| 83 | + token: ${{ secrets.GH_TOKEN }} |
| 84 | + - name: Determine current branch |
| 85 | + id: branch |
| 86 | + working-directory: target |
| 87 | + run: | |
| 88 | + branch=$(git rev-parse --abbrev-ref HEAD) |
| 89 | + echo "Current branch: ${branch}" |
| 90 | + echo ::set-output name=branch::${branch} |
| 91 | + - name: Sync workflows |
| 92 | + run: | |
| 93 | + mkdir -p target/.github/workflows/ |
| 94 | + rsync --verbose --verbose --archive -F "source/.github/workflows/" "target/.github/workflows/" |
| 95 | + rm -f target/.github/dependabot.yml |
| 96 | + rm -f target/.github/stale.yml |
| 97 | + rm -f target/.github/release-drafter.yml |
| 98 | + rm -f target/.github/workflows/dependency-update.yml |
| 99 | + - name: Copy files from source to target branches |
| 100 | + run: | |
| 101 | + while IFS= read -r file; do |
| 102 | + dest="$(dirname $file)" |
| 103 | + mkdir -p target/$dest |
| 104 | + cp -r source/$file target/$dest |
| 105 | + done <<< "$FILES" |
| 106 | + env: |
| 107 | + FILES: |- |
| 108 | + .gitignore |
| 109 | + .github/renovate.json |
| 110 | + .github/release.yml |
| 111 | + .github/ISSUE_TEMPLATE/bug_report.yaml |
| 112 | + .github/ISSUE_TEMPLATE/config.yml |
| 113 | + .github/ISSUE_TEMPLATE/new_feature.yaml |
| 114 | + .github/ISSUE_TEMPLATE/other.yaml |
| 115 | + gradle/wrapper/* |
| 116 | + gradlew* |
| 117 | + MAINTAINING.md |
| 118 | + SECURITY.md |
| 119 | + LICENSE |
| 120 | + config/HEADER |
| 121 | + config/spotless.license.java |
| 122 | + config/checkstyle/checkstyle.xml |
| 123 | + config/checkstyle/suppressions.xml |
| 124 | + - name: Create Pull Request - ${{ steps.branch.outputs.branch }} |
| 125 | + uses: peter-evans/create-pull-request@v4 |
| 126 | + with: |
| 127 | + path: target |
| 128 | + token: ${{ secrets.GH_TOKEN }} |
| 129 | + committer: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}> |
| 130 | + author: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}> |
| 131 | + commit-message: Update common files |
| 132 | + title: "[${{ matrix.repo }}] Update common files for branch ${{ steps.branch.outputs.branch }}" |
| 133 | + body: Update common files |
| 134 | + labels: "relates-to: build" |
| 135 | + branch: sync-files-${{ steps.branch.outputs.branch }} |
| 136 | + base: ${{ steps.branch.outputs.branch }} |
| 137 | + add-paths: | |
| 138 | + .gitignore |
| 139 | + .github/* |
| 140 | + .github/ISSUE_TEMPLATE/* |
| 141 | + .github/workflows/* |
| 142 | + gradle/* |
| 143 | + gradlew* |
| 144 | + MAINTAINING.md |
| 145 | + SECURITY.md |
| 146 | + LICENSE |
| 147 | + config/HEADER |
| 148 | + config/spotless.license.java |
| 149 | + config/checkstyle/checkstyle.xml |
| 150 | + config/checkstyle/suppressions.xml |
0 commit comments