mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Merge pull request #3632 from tridactyl/smaller_reproduction
Smaller reproduction
This commit is contained in:
commit
dd8176c4f6
4 changed files with 47 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -15,3 +15,4 @@ compiler/**/*.js
|
||||||
.*.generated.ts
|
.*.generated.ts
|
||||||
.tmp/
|
.tmp/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.build_cache/
|
||||||
|
|
|
@ -4,10 +4,18 @@ set -e
|
||||||
err() { echo "error: line $(caller)"; }
|
err() { echo "error: line $(caller)"; }
|
||||||
trap err ERR
|
trap err ERR
|
||||||
|
|
||||||
|
mkdir -p .build_cache
|
||||||
cd src/static
|
cd src/static
|
||||||
|
|
||||||
authors="../../build/static/authors.html"
|
authors="../../build/static/authors.html"
|
||||||
|
|
||||||
sed "/REPLACETHIS/,$ d" authors.html > "$authors"
|
sed "/REPLACETHIS/,$ d" authors.html > "$authors"
|
||||||
git shortlog -sn HEAD | cut -c8- | awk '!seen[$0]++' | sed 's/^/<p>/' | sed 's/$/<\/p>/' >> "$authors"
|
|
||||||
|
# If we're in a git repo, refresh the cache
|
||||||
|
if [ -d "../../.git/" ]; then
|
||||||
|
git shortlog -sn HEAD | cut -c8- | awk '!seen[$0]++' | sed 's/^/<p>/' | sed 's/$/<\/p>/' > ../../.build_cache/authors
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat ../../.build_cache/authors >> "$authors"
|
||||||
|
|
||||||
sed "1,/REPLACETHIS/ d" authors.html >> "$authors"
|
sed "1,/REPLACETHIS/ d" authors.html >> "$authors"
|
||||||
|
|
16
scripts/sign
16
scripts/sign
|
@ -4,7 +4,7 @@ set -e
|
||||||
|
|
||||||
sign_and_submit() {
|
sign_and_submit() {
|
||||||
# Don't trust the return value of web-ext sign.
|
# Don't trust the return value of web-ext sign.
|
||||||
(source AMOKEYS && (web-ext sign -s build --api-key $AMOKEY --api-secret $AMOSECRET "$@" || true))
|
(source AMOKEYS && (yarn run web-ext sign -s build --api-key "$AMOKEY" --api-secret "$AMOSECRET" "$@" || true))
|
||||||
}
|
}
|
||||||
|
|
||||||
publish_beta_nonewtab() {
|
publish_beta_nonewtab() {
|
||||||
|
@ -23,6 +23,7 @@ publish_beta() {
|
||||||
scripts/version.js beta
|
scripts/version.js beta
|
||||||
sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json
|
sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json
|
||||||
sign_and_submit
|
sign_and_submit
|
||||||
|
tar --exclude-from=<(.grep -v .build_cache/ .gitignore) --exclude-vcs -czf ../../public_html/betas/tridactyl_source_beta.tar.gz .
|
||||||
}
|
}
|
||||||
|
|
||||||
build_no_sign_beta(){
|
build_no_sign_beta(){
|
||||||
|
@ -31,9 +32,9 @@ build_no_sign_beta(){
|
||||||
scripts/version.js beta
|
scripts/version.js beta
|
||||||
sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json
|
sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json
|
||||||
mkdir -p web-ext-artifacts
|
mkdir -p web-ext-artifacts
|
||||||
$(yarn bin)/web-ext build --source-dir ./build --overwrite-dest
|
yarn run web-ext build --source-dir ./build --overwrite-dest
|
||||||
for f in web-ext-artifacts/*.zip; do
|
for f in web-ext-artifacts/*.zip; do
|
||||||
mv $f ${f%.zip}.xpi
|
mv "$f" "${f%.zip}".xpi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,9 +43,9 @@ build_no_sign_stable(){
|
||||||
yarn run build --no-native
|
yarn run build --no-native
|
||||||
sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json
|
sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json
|
||||||
mkdir -p web-ext-artifacts
|
mkdir -p web-ext-artifacts
|
||||||
$(yarn bin)/web-ext build --source-dir ./build --overwrite-dest
|
yarn run web-ext build --source-dir ./build --overwrite-dest
|
||||||
for f in web-ext-artifacts/*.zip; do
|
for f in web-ext-artifacts/*.zip; do
|
||||||
mv $f ${f%.zip}.xpi
|
mv "$f" "${f%.zip}".xpi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +54,7 @@ publish_stable() {
|
||||||
yarn run build --no-native
|
yarn run build --no-native
|
||||||
sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json
|
sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json
|
||||||
sign_and_submit
|
sign_and_submit
|
||||||
tar --exclude-from=.gitignore -czf ../../public_html/betas/tridactyl_source.tar.gz .
|
tar --exclude-from=<(grep -v .build_cache/ .gitignore) --exclude-vcs -czf ../../public_html/betas/tridactyl_source.tar.gz .
|
||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -61,5 +62,6 @@ case $1 in
|
||||||
nosignstable) build_no_sign_stable;;
|
nosignstable) build_no_sign_stable;;
|
||||||
nosignbeta) build_no_sign_beta;;
|
nosignbeta) build_no_sign_beta;;
|
||||||
nonewtab) publish_beta_nonewtab;;
|
nonewtab) publish_beta_nonewtab;;
|
||||||
*|beta) publish_beta;;
|
beta) publish_beta;;
|
||||||
|
*) publish_beta;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const { exec } = require("child_process")
|
const { exec } = require("child_process")
|
||||||
|
const fs = require("fs")
|
||||||
|
|
||||||
function bump_version(versionstr, component = 2) {
|
function bump_version(versionstr, component = 2) {
|
||||||
const versionarr = versionstr.split(".")
|
const versionarr = versionstr.split(".")
|
||||||
|
@ -12,21 +13,37 @@ function bump_version(versionstr, component = 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function add_beta(versionstr) {
|
async function add_beta(versionstr) {
|
||||||
return new Promise((resolve, err) => {
|
await fs.promises.mkdir(".build_cache", {recursive: true})
|
||||||
exec("git rev-list --count HEAD", (execerr, stdout, stderr) => {
|
try {
|
||||||
if (execerr) err(execerr)
|
await fs.promises.access(".git")
|
||||||
resolve(versionstr + "pre" + stdout.trim())
|
await new Promise((resolve, err) => {
|
||||||
|
exec("git rev-list --count HEAD > .build_cache/count", (execerr, stdout, stderr) => {
|
||||||
|
if (execerr) err(execerr)
|
||||||
|
resolve(stdout.trim())
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
catch {
|
||||||
|
; // Not in a git directory - don't do anything
|
||||||
|
}
|
||||||
|
return versionstr + "pre" + (await fs.promises.readFile(".build_cache/count", {encoding: "utf8"})).trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function get_hash() {
|
async function get_hash() {
|
||||||
return new Promise((resolve, err) => {
|
await fs.promises.mkdir(".build_cache", {recursive: true})
|
||||||
exec("git rev-parse --short HEAD", (execerr, stdout, stderr) => {
|
try {
|
||||||
if (execerr) err(execerr)
|
await fs.promises.access(".git")
|
||||||
resolve(stdout.trim())
|
await new Promise((resolve, err) => {
|
||||||
|
exec("git rev-parse --short HEAD > .build_cache/hash", (execerr, stdout, stderr) => {
|
||||||
|
if (execerr) err(execerr)
|
||||||
|
resolve(stdout.trim())
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
catch {
|
||||||
|
; // Not in a git directory - don't do anything
|
||||||
|
}
|
||||||
|
return (await fs.promises.readFile(".build_cache/hash", {encoding: "utf8"})).trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_update_json(versionstr) {
|
function make_update_json(versionstr) {
|
||||||
|
@ -102,7 +119,7 @@ async function main() {
|
||||||
make_update_json(manifest.version),
|
make_update_json(manifest.version),
|
||||||
)
|
)
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.warn("updates.json wasn't updated: " + e)
|
console.warn("Unless you're the buildbot, ignore this error: " + e)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save manifest.json
|
// Save manifest.json
|
||||||
|
|
Loading…
Add table
Reference in a new issue