-
-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (160 loc) · 4.89 KB
/
from-pulsar.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
name: Sync from Pulsar
on:
schedule:
- cron: 0 * * * *
workflow_dispatch:
concurrency:
group: from-pulsar
cancel-in-progress: true
jobs:
sync:
runs-on: ubuntu-22.04
steps:
- name: checkout repo
uses: actions/[email protected]
with:
path: sync
- name: checkout pulsar
uses: actions/[email protected]
with:
repository: pulsar-edit/pulsar
# TODO change this back to master when the PR is merged
ref: i18n
path: pulsar
- name: check if pulsar received a commit since last run
id: check
run: |
node sync/script/has-new-commit.mjs >> $GITHUB_OUTPUT
- name: update sync repo with new sources
if: ${{ steps.check.outputs.has-new == 'true' }}
run: |
rm -rf sync/cson
mkdir -p sync/cson
cp -R pulsar/i18n sync/cson/core
packages=(
"about"
"archive-view"
"atom-dark-syntax"
"atom-dark-ui"
"atom-light-syntax"
"atom-light-ui"
"autocomplete-atom-api"
"autocomplete-css"
"autocomplete-html"
"autocomplete-plus"
"autocomplete-snippets"
"autoflow"
"autosave"
"background-tips"
"base16-tomorrow-dark-theme"
"base16-tomorrow-light-theme"
"bookmarks"
"bracket-matcher"
"command-palette"
"dalek"
"deprecation-cop"
"dev-live-reload"
"encoding-selector"
"exception-reporting"
"find-and-replace"
"fuzzy-finder"
"git-diff"
"go-to-line"
"grammar-selector"
"image-view"
"incompatible-packages"
"keybinding-resolver"
"language-c"
"language-clojure"
"language-coffee-script"
"language-csharp"
"language-css"
"language-gfm"
"language-git"
"language-go"
"language-html"
"language-hyperlink"
"language-java"
"language-javascript"
"language-json"
"language-less"
"language-make"
"language-mustache"
"language-objective-c"
"language-perl"
"language-php"
"language-property-list"
"language-python"
"language-ruby"
"language-ruby-on-rails"
"language-rust-bundled"
"language-sass"
"language-shellscript"
"language-source"
"language-sql"
"language-text"
"language-todo"
"language-toml"
"language-typescript"
"language-xml"
"language-yaml"
"line-ending-selector"
"link"
"markdown-preview"
"notifications"
"one-dark-syntax"
"one-dark-ui"
"one-light-syntax"
"one-light-ui"
"open-on-github"
"package-generator"
"settings-view"
"solarized-dark-syntax"
"solarized-light-syntax"
"spell-check"
"status-bar"
"styleguide"
"tabs"
"timecop"
"tree-view"
"update-package-dependencies"
"welcome"
"whitespace"
"wrap-guide"
)
mkdir -p sync/cson/packages
for package in "${packages[@]}"; do
if [ -d "pulsar/packages/$package/i18n" ]; then
cp -R "pulsar/packages/$package/i18n" "sync/cson/packages/$package"
fi
done
- name: check if should continue
if: ${{ steps.check.outputs.has-new == 'true' }}
id: should-continue
working-directory: sync
run: |
if [ -z "$(git status --porcelain=v1 2>/dev/null)" ]; then
echo "should-continue=false" >> $GITHUB_OUTPUT
else
echo "should-continue=true" >> $GITHUB_OUTPUT
fi
- name: setup pnpm (yes)
if: ${{ steps.check.outputs.has-new == 'true' && steps.should-continue.outputs.should-continue == 'true' }}
uses: pnpm/[email protected]
with:
version: "8.5.1"
- name: update and commit JSON from new CSON
if: ${{ steps.check.outputs.has-new == 'true' && steps.should-continue.outputs.should-continue == 'true' }}
working-directory: sync
run: |
pnpm i
rm -rf json
node script/update-json.mjs
git config --global user.name smol
git config --global user.email [email protected]
echo "https://meadowsys:${{ secrets.GITHUB_TOKEN }}@github.com" > .git/credentials
git config --global credential.helper "store --file=.git/credentials"
git config --unset-all http.https://github.com/.extraheader # https://stackoverflow.com/a/69979203
git add -A
git commit -m "(automated) updating JSON files from pulsar-edit/pulsar@${{ steps.check.outputs.pulsar-commit }}"
git push