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

feat: reindex files at GH push (make blocae work!) #133

Merged
merged 54 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
7dec848
add blocae dir with 10 msczs
emanuelvale Nov 4, 2024
9bf15f9
feat: github action reindexes collections in PRs
brunoro Nov 4, 2024
519f444
feat: create folders for mscz files in project directory
brunoro Nov 4, 2024
6451d5d
fix: syntax
brunoro Nov 4, 2024
3b71e16
fix: push to correct head
brunoro Nov 4, 2024
5e9f211
feat: commit result to GH
brunoro Nov 8, 2024
c559999
fix: diff check
brunoro Nov 8, 2024
e6d7c02
fix: remove commit check
brunoro Nov 8, 2024
6e25ffa
feat: try to only generate files that matter
brunoro Nov 8, 2024
6120659
fix: changed file check
brunoro Nov 8, 2024
c26db0b
feat: try to fetch before doing anything
brunoro Nov 8, 2024
b511f76
feat: move mscz files to their directories in gh script
brunoro Nov 8, 2024
8855a02
fix: moving files around
brunoro Nov 8, 2024
e28f95d
don't commit for now
brunoro Nov 8, 2024
6faeb34
fix: bash doesn't like spaces
brunoro Nov 8, 2024
a898d9c
fix: fuck bash
brunoro Nov 8, 2024
fc15b1f
log
brunoro Nov 8, 2024
80cfab0
fix: aha!
brunoro Nov 8, 2024
3746289
fix: index collection
brunoro Nov 8, 2024
3c5621c
fix: try to push to PR
brunoro Nov 8, 2024
b0c1767
fix: skip if last commit was automated
brunoro Nov 8, 2024
8d143c5
fix: checkout branch
brunoro Nov 8, 2024
f43204f
finish formatting blocae songs
emanuelvale Nov 8, 2024
67328b9
feat: upterm session on failure
brunoro Nov 15, 2024
1acdf5b
fix: check for indexer commit
brunoro Nov 15, 2024
a0ab4d9
fix: make sure we're in the correct branch
brunoro Nov 15, 2024
3ab6697
fix: skip commit check
brunoro Nov 15, 2024
b854af1
feat: check email
brunoro Nov 15, 2024
a6e4c0c
move mscz from subfolder to blocae rootdir
emanuelvale Nov 15, 2024
2ba6149
fix: set upstream branch
brunoro Nov 15, 2024
9a6e935
chore: generate collection from mscz files (27)
Nov 15, 2024
eec9d38
Revert "chore: generate collection from mscz files (27)"
brunoro Nov 15, 2024
849bc54
fix: git add new files
brunoro Nov 15, 2024
c98934a
fix: add pwd
brunoro Nov 15, 2024
a1adce3
debug: verbose mode in indexer
brunoro Nov 15, 2024
891de47
fix: asset creation path
brunoro Nov 15, 2024
fbb52d1
fix: commit moved files
brunoro Nov 15, 2024
838e5e9
fix: set git credentials
brunoro Nov 15, 2024
1d39b5c
fix: use git mv
brunoro Nov 15, 2024
cf98c18
fix: rm cached oldfile
brunoro Nov 15, 2024
cffeced
fix: use git mv
brunoro Nov 15, 2024
3a760b3
fix: check staged
brunoro Nov 15, 2024
d2eabcd
fix: commit only collection
brunoro Nov 15, 2024
c5a4d55
feat: additional instrument name mapping
brunoro Nov 15, 2024
9748736
feat: reorder instrument aliases
brunoro Nov 15, 2024
a114f7c
lower case blocae files
emanuelvale Nov 15, 2024
d5de93d
feat: generate assets shell
brunoro Dec 29, 2024
6285d52
feat: collapse media generation steps
brunoro Dec 29, 2024
1f7fc38
chore: move mscz files to folders with the same name (manual)
brunoro Dec 29, 2024
56c6a83
fix: don't reprocess deleted files
brunoro Dec 29, 2024
780c4ca
fix: handle multipage assets gracefully
brunoro Dec 29, 2024
41c1bc2
feat: adjust script path
brunoro Dec 29, 2024
87180ea
fix: ungroup bin call
brunoro Dec 29, 2024
c05cabb
chore: generate collection from mscz files (44)
Dec 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
63 changes: 0 additions & 63 deletions .github/workflows/generate-collection.yaml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/index-collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Generate collection from MuseScore files

on:
workflow_dispatch:
pull_request:
paths:
- "public/collection/**"

jobs:
generate-collection:
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Make sure the indexer is on the latest ref of the PR branch
run: |
git fetch origin ${{ github.event.pull_request.head.ref }}:${{ github.event.pull_request.head.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
git branch --set-upstream-to=origin/${{ github.event.pull_request.head.ref }}
- name: Skip if current commit is from the indexer
run: |
LAST_EMAIL=$(git log -1 --pretty=format:%ae)
if [ "$LAST_EMAIL" = "[email protected]" ]; then
echo "Last commit was from the indexer, skipping"
exit 78
fi
- name: Get apt dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: jq libegl-dev libasound2 libjack0 librust-gobject-sys-dev libnss3 xvfb
version: 1.0
- name: Setup MuseScore AppImage
run: |
make download-musescore
./musescore_3.6.2.AppImage --appimage-extract
- name: Restore npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: |
npm ci
- name: Make sure any mscz files are in folders with the same name
run: |
bash scripts/wrapMsczInFolder.sh "public/collection"
git config --global user.email "[email protected]"
git config --global user.name "cadern.in indexer"
git diff --staged --quiet || git commit -m "chore: move mscz files to folders with the same name (${{github.run_number}})"
- name: Generate svg, midi and metajson assets from mscz
shell: sh
run: |
bash scripts/generateMsczAssets.sh ${{ github.event.pull_request.base.sha }} "xvfb-run squashfs-root/AppRun"
- name: Index collection
run: |
cp -r public/collection /tmp/collection
npm run index-collection -- -i /tmp/collection -o public/collection --verbose
git add -v public/collection
- uses: EndBug/add-and-commit@v9
with:
message: "chore: generate collection from mscz files (${{github.run_number}})"
add: "public/collection"
push: true
author_name: "cadern.in indexer"
author_email: "[email protected]"
- uses: lhotari/action-upterm@v1
if: failure()
with:
wait-timeout-minutes: 5
113 changes: 113 additions & 0 deletions public/collection/blocae/a_banda/a_banda.metajson
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"composer": "Chico Buarque",
"duration": 120,
"fileVersion": 302,
"hasHarmonies": "true",
"hasLyrics": "false",
"keysig": 2,
"lyrics": "",
"measures": 68,
"mscoreVersion": "3.6.2",
"pageFormat": {
"height": 297,
"twosided": "true",
"width": 210
},
"pages": 14,
"parts": [
{
"harmonyCount": 54,
"hasDrumStaff": "false",
"hasPitchedStaff": "true",
"hasTabStaff": "false",
"instrumentId": "wind.flutes.flute",
"isVisible": "true",
"lyricCount": 0,
"name": "Flauta Transversal",
"program": 73
},
{
"harmonyCount": 54,
"hasDrumStaff": "false",
"hasPitchedStaff": "true",
"hasTabStaff": "false",
"instrumentId": "wind.reed.saxophone.alto",
"isVisible": "true",
"lyricCount": 0,
"name": "Saxofone Alto",
"program": 65
},
{
"harmonyCount": 54,
"hasDrumStaff": "false",
"hasPitchedStaff": "true",
"hasTabStaff": "false",
"instrumentId": "wind.reed.saxophone.tenor",
"isVisible": "true",
"lyricCount": 0,
"name": "Saxofone Tenor",
"program": 66
},
{
"harmonyCount": 54,
"hasDrumStaff": "false",
"hasPitchedStaff": "true",
"hasTabStaff": "false",
"instrumentId": "brass.trumpet.bflat",
"isVisible": "true",
"lyricCount": 0,
"name": "Trompete em B♭",
"program": 56
},
{
"harmonyCount": 54,
"hasDrumStaff": "false",
"hasPitchedStaff": "true",
"hasTabStaff": "false",
"instrumentId": "brass.trombone",
"isVisible": "true",
"lyricCount": 0,
"name": "Trombone",
"program": 57
},
{
"harmonyCount": 0,
"hasDrumStaff": "false",
"hasPitchedStaff": "true",
"hasTabStaff": "false",
"instrumentId": "brass.trumpet.bflat",
"isVisible": "true",
"lyricCount": 0,
"name": "Trompete em B♭",
"program": 56
},
{
"harmonyCount": 0,
"hasDrumStaff": "false",
"hasPitchedStaff": "true",
"hasTabStaff": "false",
"instrumentId": "brass.trombone",
"isVisible": "true",
"lyricCount": 0,
"name": "Trombone",
"program": 57
}
],
"poet": "Chico Buarque",
"previousSource": "https://musescore.com/user/35075845/scores/9095813",
"subtitle": "",
"tempo": 0,
"tempoText": "",
"textFramesData": {
"composers": [
],
"poets": [
],
"subtitles": [
],
"titles": [
]
},
"timesig": "2/4",
"title": "A Banda"
}
Binary file added public/collection/blocae/a_banda/a_banda.midi
Binary file not shown.
Binary file added public/collection/blocae/a_banda/a_banda.mscz
Binary file not shown.
Loading