Skip to content

Commit f4dd0e5

Browse files
committed
build via workflow & upload artifact
1 parent ac11f60 commit f4dd0e5

File tree

5 files changed

+66
-43
lines changed

5 files changed

+66
-43
lines changed

#!inf.json

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -202,40 +202,7 @@
202202
<<<),
203203
"gi0.PINF.it/build/v0 @ # onCommand() build": (inf () >>>
204204
{
205-
"gi0.PINF.it/build/v0 @ # :runner: build() /dist/firephp.build": "",
206-
207-
"gi0.PINF.it/build/v0 @ # /": (inf () >>>
208-
{
209-
"# run": (run.bash.origin.method.progress () >>>
210-
211-
pushd "dist/firephp.build" > /dev/null
212-
213-
# Remove files that we do not need
214-
# TODO: Do this in a better way and coordinate with .gitignore
215-
rm -Rf scripts/devtools/dist/dist/riot.min.js
216-
rm -Rf scripts/devtools/dist/dist/riot.js
217-
rm -Rf scripts/devtools/dist/dist/babel-regenerator-runtime.js
218-
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/dist/domplate.browser.js
219-
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/dist/domplate-eval.browser.js
220-
rm -Rf lib/github.com~pinf~pinf-for-mozilla-web-ext/scripts/lib/pinf-loader-core.browser.js
221-
rm -Rf lib/github.com~pinf~pinf-for-mozilla-web-ext/scripts/lib/babel-regenerator-runtime.js
222-
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/*/*.preview.htm
223-
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/reps.json
224-
rm -Rf scripts/devtools/dist/dist/reps/io.shields.img.rep.js
225-
rm -Rf scripts/devtools/dist/dist/reps/div.rep.js
226-
rm -Rf scripts/devtools/dist/dist/reps/golden-layout.rep.js
227-
rm -Rf skin/box.png
228-
229-
# Remove signed archive as it needs to be re-signed
230-
rm -f ../firephp.build.xpi 2> /dev/null || true
231-
232-
popd > /dev/null
233-
234-
BO_cecho "\nBuilt extension source can be found at: dist/firephp.build/" YELLOW BOLD
235-
BO_cecho "This source can be loaded into a browser when running in extension development mode.\n" YELLOW BOLD
236-
<<<)
237-
}
238-
<<<)
205+
"gi0.PINF.it/build/v0 @ # :runner: build() /dist/firephp.build": ""
239206
}
240207
<<<),
241208
"gi0.PINF.it/build/v0 @ # onCommand() publish": (inf () >>>

.github/workflows/build.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,29 @@ jobs:
99
node-version:
1010
- 13.x
1111
steps:
12-
-
13-
uses: actions/checkout@v1
14-
-
15-
name: Install
16-
run: npm install
17-
-
18-
name: Build
19-
run: npm run build
12+
- uses: actions/checkout@v2
13+
14+
- name: Cache node modules
15+
uses: actions/cache@v2
16+
env:
17+
cache-name: cache-node-modules
18+
with:
19+
# npm cache files are stored in `~/.npm` on Linux/macOS
20+
path: ~/.npm
21+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json')-${{ hashFiles('npm-shrinkwrap.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-build-${{ env.cache-name }}-
24+
${{ runner.os }}-build-
25+
${{ runner.os }}-
26+
27+
- name: Install Dependencies
28+
run: npm install
29+
30+
- name: Build
31+
run: npm build
32+
33+
- name: Upload extension build
34+
uses: actions/upload-artifact@v1
35+
with:
36+
name: firephp
37+
path: dist/firephp.zip

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ node_modules/
1313
/dist/firephp.build.zip
1414
/tests/*/.extension.built
1515

16+
/dist/firephp.zip
1617
/dist/firephp.build-docker
1718

1819
# Files that we do not need

.postbuild.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash.origin.script
2+
3+
# TODO: Move to '#!inf.json' once pinf.it/build/v0 executes instructions in sequence.
4+
5+
pushd "dist/firephp.build" > /dev/null
6+
7+
# Remove files that we do not need
8+
# TODO: Do this in a better way and coordinate with .gitignore
9+
rm -Rf scripts/devtools/dist/dist/riot.min.js
10+
rm -Rf scripts/devtools/dist/dist/riot.js
11+
rm -Rf scripts/devtools/dist/dist/babel-regenerator-runtime.js
12+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/dist/domplate.browser.js
13+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/dist/domplate-eval.browser.js
14+
rm -Rf lib/github.com~pinf~pinf-for-mozilla-web-ext/scripts/lib/pinf-loader-core.browser.js
15+
rm -Rf lib/github.com~pinf~pinf-for-mozilla-web-ext/scripts/lib/babel-regenerator-runtime.js
16+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/*/*.preview.htm
17+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/reps.json
18+
rm -Rf scripts/devtools/dist/dist/reps/io.shields.img.rep.js
19+
rm -Rf scripts/devtools/dist/dist/reps/div.rep.js
20+
rm -Rf scripts/devtools/dist/dist/reps/golden-layout.rep.js
21+
rm -Rf skin/box.png
22+
23+
# Remove signed archive as it needs to be re-signed
24+
rm -f ../firephp.build.xpi 2> /dev/null || true
25+
26+
popd > /dev/null
27+
28+
pushd "dist" > /dev/null
29+
30+
mv firephp.build firephp
31+
zip -r firephp.zip firephp/
32+
mv firephp firephp.build
33+
34+
popd > /dev/null
35+
36+
BO_cecho "\nBuilt extension source can be found at: dist/firephp.build/" YELLOW BOLD
37+
BO_cecho "This source can be loaded into a browser when running in extension development mode.\n" YELLOW BOLD

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"scripts": {
1717
"test": "./.prepare.sh; pinf.it ./#!inf.json test",
1818
"dev": "./.prepare.sh; pinf.it ./#!inf.json dev --watch",
19-
"build": "./.prepare.sh; pinf.it ./#!inf.json build",
19+
"build": "./.prepare.sh; pinf.it ./#!inf.json build; ./.postbuild.sh",
2020
"build-via-docker": "./src/docker/build.sh",
2121
"publish": "./.prepare.sh; pinf.it ./#!inf.json publish"
2222
}

0 commit comments

Comments
 (0)