-
Notifications
You must be signed in to change notification settings - Fork 11
175 lines (175 loc) · 5.13 KB
/
files-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Files sync
on:
schedule:
- cron: '0 5 * * *'
jobs:
sync-files:
if: github.repository == 'micronaut-projects/micronaut-project-template'
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
repo:
- acme
- aot
- aws
- azure
- cache
- cassandra
- chatbots
- coherence
- control-panel
- core
- crac
- data
- discovery-client
- eclipsestore
- elasticsearch
- email
- flyway
- fuzzing
- gcp
- graphql
- groovy
- graal-languages
- grpc
- guice
- hibernate-validator
- jackson-xml
- jaxrs
- jms
- jmx
- json-schema
- kafka
- kotlin
- kubernetes
- langchain4j
- liquibase
- logging
- micrometer
- microstream
- mongodb
- mqtt
- multitenancy
- nats
- neo4j
- object-storage
- openapi
- opensearch
- oracle-cloud
- picocli
- platform
- problem-json
- pulsar
- r2dbc
- rabbitmq
- reactor
- redis
- rss
- rxjava2
- rxjava3
- security
- serialization
- servlet
- session
- sourcegen
- spring
- sql
- test
- test-resources
- toml
- tracing
- validation
- views
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
path: source
- name: Checkout target - default branch
uses: actions/checkout@v4
with:
repository: micronaut-projects/micronaut-${{ matrix.repo }}
path: target
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Determine current branch
id: branch
working-directory: target
run: |
branch=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: ${branch}"
echo "branch=${branch}" >> $GITHUB_OUTPUT
- name: Sync workflows
run: |
mkdir -p target/.github/workflows/
rsync --verbose --verbose --archive -F "source/.github/workflows/" "target/.github/workflows/"
rm -f target/.github/dependabot.yml
rm -f target/.github/stale.yml
rm -f target/.github/release-drafter.yml
rm -f target/.github/workflows/release-notes.yml
rm -f target/.github/workflows/dependency-update.yml
rm -f target/.github/workflows/sonarqube.yml
- name: Copy files from source to target branches
run: |
while IFS= read -r file; do
dest_dirname="$(dirname $file)"
dest_filename="$(basename $file)"
mkdir -p target/$dest_dirname
[ ! -f target/${dest_dirname}/${dest_filename}.lock ] && cp source/$file target/${dest_dirname}/${dest_filename}
done <<< "$FILES"
env:
FILES: |-
.editorconfig
.gitattributes
.gitignore
.github/renovate.json
.github/release.yml
.github/ISSUE_TEMPLATE/bug_report.yaml
.github/ISSUE_TEMPLATE/config.yml
.github/ISSUE_TEMPLATE/new_feature.yaml
.github/ISSUE_TEMPLATE/other.yaml
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
MAINTAINING.md
SECURITY.md
LICENSE
config/HEADER
config/spotless.license.java
config/checkstyle/checkstyle.xml
config/checkstyle/suppressions.xml
- name: Sleep for 3 minutes to avoid rate limiting
run: sleep 180s
shell: bash
- name: Create Pull Request - ${{ steps.branch.outputs.branch }}
uses: peter-evans/create-pull-request@v7
with:
path: target
token: ${{ secrets.GH_TOKEN }}
committer: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}>
author: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}>
commit-message: Update common files
title: "[${{ matrix.repo }}] Update common files for branch ${{ steps.branch.outputs.branch }}"
body: Update common files
labels: "relates-to: build"
branch: sync-files-${{ steps.branch.outputs.branch }}
base: ${{ steps.branch.outputs.branch }}
add-paths: |
.editorconfig
.gitattributes
.gitignore
.github/*
.github/ISSUE_TEMPLATE/*
.github/workflows/*
gradle/*
gradlew*
MAINTAINING.md
SECURITY.md
LICENSE
config/HEADER
config/spotless.license.java
config/checkstyle/checkstyle.xml
config/checkstyle/suppressions.xml