You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Prepare copy-workflow for setting up unified CI for JS repos (#239)
* move config*.json files to configs directory
* rename configs/*.json
* make checks aware of all the configs/*.json
* turn configs into objects with repositories key
* make files part of the config
* move language specific copy-workflow setup to actions
* make dispatch workflow support more than one config json
* create fewer batches if possible
* set up copy-workflow actions properly
* extract defaults from config separately
* bring back double toJson
* use copy-workflow actions from same branch
* use compact json representation for storing FILES
* fix files and local actions
* run actions from template repo
* add missing shell property to actions
* add configs README
* set deploy_versioning=true for go repositories
* address review comments
* restore hardcoded template-repo reference
* add section on config testing
* fix batches creation
* fix command that produces batches
* fix needs update logic
Copy file name to clipboardExpand all lines: .github/workflows/copy-workflow.yml
+34-89Lines changed: 34 additions & 89 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,6 @@ on:
8
8
head_commit_url:
9
9
description: "github.event.head_commit.url of the dispatcher"
10
10
required: true
11
-
files:
12
-
description: "List of files to deploy"
13
-
required: true
14
11
targets:
15
12
description: "List of repositories to deploy to"
16
13
required: true
@@ -28,7 +25,7 @@ jobs:
28
25
TEMPLATE_REPO_DIR: "template-repo"
29
26
TEMPLATE_DIR: "templates"
30
27
NEEDS_UPDATE: 0
31
-
INITIAL_TEST_DEPLOYMENT: 0
28
+
INITIAL_WORKFLOW_DEPLOYMENT: 0
32
29
GO_VERSION_BUMP: 0
33
30
FILES: ""
34
31
GITHUB_USER: "web3-bot"
@@ -48,11 +45,6 @@ jobs:
48
45
uses: actions/checkout@v2
49
46
with:
50
47
path: ${{ env.TEMPLATE_REPO_DIR }}
51
-
- uses: actions/setup-go@v2
52
-
with:
53
-
# This should be the same Go version we use in the go-check workflow.
54
-
# go mod tidy, go vet, staticcheck and gofmt might behave differently depending on the version.
55
-
go-version: "1.17.x"
56
48
- name: determine GitHub default branch
57
49
working-directory: ${{ env.TARGET_REPO_DIR }}
58
50
run: |
@@ -63,105 +55,58 @@ jobs:
63
55
run: |
64
56
git config user.name ${{ env.GITHUB_USER }}
65
57
git config user.email ${{ env.GITHUB_EMAIL }}
66
-
- name: is initial test workflow deployment
58
+
- name: determine files to add
59
+
# By setting the environment variable, it's possible to programmatically add / modify this list.
60
+
# See https://github.com/protocol/.github/blob/38135c75e47839623bf9b2748275d8c6167a8fa8/.github/workflows/copy-workflow.yml#L163-L168 for an example, how we used to make use of this.
67
61
run: |
68
-
if [[ ! -f $TARGET_REPO_DIR/.github/workflows/go-test.yml ]]; then
69
-
echo "INITIAL_TEST_DEPLOYMENT=1" >> $GITHUB_ENV
70
-
fi
71
-
- name: remove Travis (on initial deployment)
72
-
if: ${{ env.INITIAL_TEST_DEPLOYMENT == 1 }}
62
+
files=${{ toJson(toJson(matrix.cfg.files)) }}
63
+
files=$(echo -e "$files" | jq -c '.')
64
+
echo "FILES=$files" >> $GITHUB_ENV
65
+
- name: is initial workflow deployment
66
+
# INITIAL_WORKFLOW_DEPLOYMENT=1 iff none of the files in the target repository exist yet
67
+
run: |
68
+
initial_workflow_deployment=1
69
+
for f in $(jq -r '.[]' <<< ${{ toJson(env.FILES) }}); do
# By setting the environment variable, it's possible to programmatically add / modify this list.
160
-
# See https://github.com/protocol/.github/blob/38135c75e47839623bf9b2748275d8c6167a8fa8/.github/workflows/copy-workflow.yml#L163-L168 for an example, how we used to make use of this.
0 commit comments