Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to slowly uncurse/unbreak this build process #8

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Download dependencies and build a combined, minified source for release

on:
push:
branches:
- main

jobs:
build:
Expand All @@ -16,6 +14,7 @@ jobs:
- name: Install dependencies
run: |
npm install
mkdir lib dist
mv node_modules/dexie/dist/dexie.js lib/dexie.js
mv node_modules/dexie-export-import/dist/dexie-export-import.js lib/dexie-export-import.js
mv node_modules/downloadjs/download.js lib/download.js
Expand All @@ -24,25 +23,8 @@ jobs:
run: |
npm run build

- name: Remove node_modules
run:
rm -rf node_modules

- name: Commit source to main branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
echo `date` > .last_built_on
git add . -A
git commit -m "Minify and combine dependencies as of $(date +%s)."
git push

- name: Commit minified dependencies to release branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git fetch
git checkout release
git checkout ${GITHUB_REF##*/} dist/yomichan-data-exporter.min.js .last_built_on
git commit -am "Release minified and combined dependencies as of $(date +%s)."
git push origin release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/yomichan-data-exporter.min.js
1 change: 0 additions & 1 deletion .last_built_on

This file was deleted.

6 changes: 3 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ to that end.
+ Paste the following into the console and wait for the export + download to
finish:
#+begin_src js
fetch("https://raw.githubusercontent.com/yomidevs/yomichan-data-exporter/release/dist/yomichan-data-exporter.min.js")
fetch("https://raw.githubusercontent.com/yomidevs/yomichan-data-exporter/releases/latest/yomichan-data-exporter.min.js")
.then((resp) => resp.text())
.then((srcText) => {
eval(srcText);
Expand All @@ -50,11 +50,11 @@ fetch("https://raw.githubusercontent.com/yomidevs/yomichan-data-exporter/release
+ Unfortunately(?!), Yomichan released on Chrome doesn't have permission to
actually inject code (I tried a whole bunch of different approaches and the
permissions are just lacking) so you are going to have to paste the contents
of the [[https://raw.githubusercontent.com/yomidevs/yomichan-data-exporter/release/dist/yomichan-data-exporter.min.js][exporter code]] into the console.
of the [[https://raw.githubusercontent.com/yomidevs/yomichan-data-exporter/releases/latest/yomichan-data-exporter.min.js][exporter code]] into the console.

It is a very long "one-liner" and apparently github is pretty bad at handling
all of it being put into a code box so you may want to open the raw file,
select all, then copy and paste into the console. [[https://raw.githubusercontent.com/yomidevs/yomichan-data-exporter/release/dist/yomichan-data-exporter.min.js][Link to the raw]].
select all, then copy and paste into the console. [[https://raw.githubusercontent.com/yomidevs/yomichan-data-exporter/releases/latest/yomichan-data-exporter.min.js][Link to the raw]].

+ Finally, paste the following into the console and wait for the export +
download to finish:
Expand Down
Empty file removed dist/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion dist/yomichan-data-exporter.min.js

This file was deleted.

Empty file removed lib/.gitkeep
Empty file.
Loading
Loading