-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcopy.bara.sky
91 lines (88 loc) · 3.51 KB
/
copy.bara.sky
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
# Copybara is run by CI automatically. To run manually locally download and install copybara, then run:
# $ cd <webdev repo>
# $ ../copybara/bazel-bin/java/com/google/copybara/copybara copy.bara.sky js-sdk-push
core.workflow(
name="webdev-push-to-js-sdk",
origin=git.github_origin(
url="https://github.com/lightsparkdev/webdev.git",
ref="main",
),
destination=git.github_destination(
url="https://github.com/lightsparkdev/js-sdk.git",
push="develop",
),
# Switch to ITERATIVE mode to import each commit separately.
mode="ITERATIVE",
origin_files=glob(
["js/**"],
exclude=[
"js/packages/private/**",
"js/apps/private/**",
# dependencies and lock file are different between public and private repos:
"js/yarn.lock",
# different README for private repo, see README-PUBLIC.md:
"js/README.md",
# changesets and releases are created and managed from the public repo only so we don't want to overwrite them:
"js/.changeset/*.md",
# TODO: remove public gql package
"js/packages/gql/**",
],
),
# GH actions, yarn.lock, and changesets are managed separately in each repo.
destination_files=glob(
["**"], exclude=[".github/**", "yarn.lock", ".changeset/*.md"]
),
authoring=authoring.pass_thru("Lightspark Eng <[email protected]>"),
transformations=[
metadata.restore_author("ORIGINAL_AUTHOR", search_all_changes=True),
metadata.expose_label("COPYBARA_INTEGRATE_REVIEW"),
core.move("js/README-PUBLIC.md", "README.md"),
core.move("js/", ""),
],
)
core.workflow(
name="js-sdk-push-to-webdev",
origin=git.github_origin(
url="https://github.com/lightsparkdev/js-sdk.git",
ref="main",
),
destination=git.github_pr_destination(
url="https://github.com/lightsparkdev/webdev.git",
destination_ref="main",
integrates=[],
title="Update from public js-sdk main branch",
update_description=True,
body=(
"""Update public `js` sources with the latest code from the [public repository](https://github.com/lightsparkdev/js-sdk) main branch.
This typically happens when new versions of the SDK are released and version updates need to be synced. The PR should be merged as soon as possible to avoid updates to webdev overwriting the changes in the js-sdk develop branch."""
),
),
origin_files=glob(
["**"],
# GH actions, yarn.lock, and changesets are managed separately in each repo.
exclude=[".github/**", "yarn.lock", ".changeset/*.md"],
),
destination_files=glob(
["js/**"],
exclude=[
"js/packages/private/**",
"js/apps/private/**",
# dependencies and lock file are different between public and private repos:
"js/yarn.lock",
# different README for private repo, see README-PUBLIC.md:
"js/README.md",
# TODO: remove public gql package
"js/packages/gql/**",
],
),
authoring=authoring.pass_thru("Lightspark Eng <[email protected]>"),
mode="CHANGE_REQUEST",
transformations=[
metadata.save_author("ORIGINAL_AUTHOR"),
metadata.expose_label(
"GITHUB_PR_NUMBER", new_name="Closes", separator="lightsparkdev/webdev"
),
core.move("", "js/"),
core.move("js/README.md", "js/README-PUBLIC.md"),
],
)