Skip to content

Commit 4cd9caf

Browse files
authored
Synchronize instance with template-instance (#138)
Updated Github Actions and package.json scripts to be in sync with the new format from the template-instance (e.g. using .env files for better dev-experience) + Replaced outdated instructions in README with a redirect to template-instance Setup / Usage instructions since those are always up to date. Test Plan: Ran this setup in MetaGame cred instance successfully
1 parent 6984baf commit 4cd9caf

7 files changed

+77
-36
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SOURCECRED_DISCORD_TOKEN=TjkyOTk1OFg1NTA2MTQ4NgVw.TqpnSA.fWIrGvOaQuT8Z-5-8dN-hdChkub
2+
SOURCECRED_GITHUB_TOKEN=913043df20670ec28e4428eacc80218a1bcce0dd

.github/workflows/distribute-grain.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,14 @@ jobs:
2121
run: |
2222
yarn --frozen-lockfile
2323
24-
- name: Load Data into Graph 🔌
25-
run: |
26-
yarn load
27-
yarn graph
24+
- name: Load Data and Compute Cred 🧮
25+
run: yarn sourcecred go
2826
env:
2927
SOURCECRED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3028
SOURCECRED_DISCORD_TOKEN: ${{ secrets.SOURCECRED_DISCORD_TOKEN }}
3129

32-
- name: Compute Cred 🧮
33-
run: |
34-
yarn score
35-
3630
- name: Distribute Grain 💸
37-
run: |
38-
yarn grain > grain_output.txt
31+
run: yarn grain > grain_output.txt
3932

4033
- name: Set environment variables
4134
id: pr_details

.github/workflows/generate-instance.yml

+4-9
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,20 @@ jobs:
2525
- name: Install Packages 🔧
2626
run: yarn --frozen-lockfile
2727

28-
- name: Load Data into Graph 🔌
29-
run: |
30-
yarn load
31-
yarn graph
28+
- name: Load Data and Compute Cred 🧮
29+
run: yarn sourcecred go
3230
env:
3331
SOURCECRED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3432
SOURCECRED_DISCORD_TOKEN: ${{ secrets.SOURCECRED_DISCORD_TOKEN }}
3533

36-
- name: Compute Cred 🧮
37-
run: yarn score
38-
3934
- name: Generate Frontend 🏗
4035
run: |
41-
yarn site
36+
yarn sourcecred site
4237
rm -rf ./site/{output,data,config,sourcecred.json}
4338
cp -r ./{output,data,config,sourcecred.json} ./site/
4439
4540
- name: Deploy 🚀
46-
uses: JamesIves/github-pages-deploy-action@3.5.7
41+
uses: JamesIves/github-pages-deploy-action@3.7.1
4742
with:
4843
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4944
BRANCH: gh-pages

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ site/
33
output/
44
cache/
55

6-
7-
6+
.env

README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ Some features to note:
1515
week. The `maxSimultaneousDistributions` parameter determines how many weeks
1616
of "back-distributions" to generate if the command hasn't been run in a while
1717
(or ever).
18-
- Run `yarn go` to load all the data and recalculate scores. Run `yarn go --no-load` if you
19-
don't want to load data from scratch.
20-
- Run `yarn serve` to locally serve the frontend.
21-
- Run `yarn grain` if you want to distribute Grain using the current scores and the
22-
`config/grain.json`.
23-
18+
19+
20+
For instructions on how to run the instance locally, see the [Setup and Usage Guide](https://github.com/sourcecred/template-instance#setup-and-usage).

package.json

+5-8
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@
1212
"scripts": {
1313
"clean": "rimraf cache site",
1414
"clean-all": "yarn clean && rimraf output",
15-
"load": "sourcecred load",
16-
"graph": "sourcecred graph",
17-
"score": "sourcecred score",
18-
"site": "sourcecred site",
19-
"serve": "sourcecred serve",
20-
"grain": "sourcecred grain",
21-
"go": "sourcecred go"
15+
"load": "dotenv sourcecred load",
16+
"start": "dotenv -- sourcecred go --no-load && sourcecred serve",
17+
"grain": "sourcecred grain"
2218
},
2319
"devDependencies": {
24-
"rimraf": "^3.0.2"
20+
"rimraf": "^3.0.2",
21+
"dotenv-cli": "^4.0.0"
2522
}
2623
}

yarn.lock

+59-1
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,15 @@ core-util-is@~1.0.0:
666666
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
667667
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
668668

669+
cross-spawn@^7.0.1:
670+
version "7.0.3"
671+
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
672+
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
673+
dependencies:
674+
path-key "^3.1.0"
675+
shebang-command "^2.0.0"
676+
which "^2.0.1"
677+
669678
css-in-js-utils@^2.0.0:
670679
version "2.0.1"
671680
resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz#3b472b398787291b47cfe3e44fecfdd9e914ba99"
@@ -989,6 +998,26 @@ domutils@^2.4.2:
989998
domelementtype "^2.0.1"
990999
domhandler "^3.3.0"
9911000

1001+
dotenv-cli@^4.0.0:
1002+
version "4.0.0"
1003+
resolved "https://registry.yarnpkg.com/dotenv-cli/-/dotenv-cli-4.0.0.tgz#3cdd68b87ccd63c78dbfa72aab2f639bbeba5f4b"
1004+
integrity sha512-ByKEec+ashePEXthZaA1fif9XDtcaRnkN7eGdBDx3HHRjwZ/rA1go83Cbs4yRrx3JshsCf96FjAyIA2M672+CQ==
1005+
dependencies:
1006+
cross-spawn "^7.0.1"
1007+
dotenv "^8.1.0"
1008+
dotenv-expand "^5.1.0"
1009+
minimist "^1.1.3"
1010+
1011+
dotenv-expand@^5.1.0:
1012+
version "5.1.0"
1013+
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0"
1014+
integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==
1015+
1016+
dotenv@^8.1.0:
1017+
version "8.2.0"
1018+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
1019+
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==
1020+
9921021
9931022
version "3.2.7"
9941023
resolved "https://registry.yarnpkg.com/downshift/-/downshift-3.2.7.tgz#0c40d78d1cbc24753c7a622cfc664df1c9480b4a"
@@ -1674,6 +1703,11 @@ isarray@~1.0.0:
16741703
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
16751704
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
16761705

1706+
isexe@^2.0.0:
1707+
version "2.0.0"
1708+
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
1709+
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
1710+
16771711
isobject@^3.0.1:
16781712
version "3.0.1"
16791713
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
@@ -1971,7 +2005,7 @@ minimatch@^3.0.4:
19712005
dependencies:
19722006
brace-expansion "^1.1.7"
19732007

1974-
minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@~1.2.0:
2008+
minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@~1.2.0:
19752009
version "1.2.5"
19762010
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
19772011
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
@@ -2152,6 +2186,11 @@ path-is-absolute@^1.0.0:
21522186
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
21532187
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
21542188

2189+
path-key@^3.1.0:
2190+
version "3.1.1"
2191+
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
2192+
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
2193+
21552194
21562195
version "0.1.7"
21572196
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
@@ -2812,6 +2851,18 @@ [email protected]:
28122851
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683"
28132852
integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==
28142853

2854+
shebang-command@^2.0.0:
2855+
version "2.0.0"
2856+
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
2857+
integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
2858+
dependencies:
2859+
shebang-regex "^3.0.0"
2860+
2861+
shebang-regex@^3.0.0:
2862+
version "3.0.0"
2863+
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
2864+
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
2865+
28152866
signal-exit@^3.0.0:
28162867
version "3.0.3"
28172868
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
@@ -3349,6 +3400,13 @@ which-pm-runs@^1.0.0:
33493400
resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb"
33503401
integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=
33513402

3403+
which@^2.0.1:
3404+
version "2.0.2"
3405+
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
3406+
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
3407+
dependencies:
3408+
isexe "^2.0.0"
3409+
33523410
wide-align@^1.1.0:
33533411
version "1.1.3"
33543412
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"

0 commit comments

Comments
 (0)