-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (96 loc) · 3.18 KB
/
lilypond-github-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
- name: Lilypond Generator
uses: alexandre-touret/[email protected]
name: Generate Lilypond music sheets
on:
push:
branches:
- gh-pages
jobs:
build_sheets:
runs-on: ubuntu-latest
env:
LILYPOND_FILES: "*.ly"
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Get changed files
id: getfile
run: |
echo "::set-output name=files::$(find ${{github.workspace}} -name "${{ env.LILYPOND_FILES }}" -printf "%P\n" | xargs)"
- name: LILYPOND files considered echo output
run: |
echo ${{ steps.getfile.outputs.files }}
- name: Generate PDF music sheets
uses: alexandre-touret/lilypond-github-action@master
with:
args: -V -fpdf -fpng -fmidi ${{ steps.getfile.outputs.files }}
- name: Push Local Changes
run: |
git config --local user.email "${{ secrets.GIT_USERNAME }}"
git config --local user.name "${{ secrets.GIT_EMAIL }}"
mkdir -p ${{github.workspace}}/docs/
mv -f *.midi ${{github.workspace}}/docs/
mv -f *.pdf ${{github.workspace}}/docs/
mv -f *.png ${{github.workspace}}/docs/
git add ${{github.workspace}}/docs/
git commit -m "Add changes" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
name: Generate Lilypond music sheets
on:
push:
branches:
- gh-pages
jobs:
build_sheets:
runs-on: ubuntu-latest
env:
LILYPOND_FILES: "*.ly"
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Get changed files
id: getfile
run: |
echo "::set-output name=files::$(find ${{github.workspace}} -name "${{ env.LILYPOND_FILES }}" -printf "%P\n" | xargs)"
- name: LILYPOND files considered echo output
run: |
echo ${{ steps.getfile.outputs.files }}
- name: Generate PDF music sheets
uses: alexandre-touret/lilypond-github-action@master
with:
args: -V -fpdf -fpng -fmidi ${{ steps.getfile.outputs.files }}
- name: Push Local Changes
run: |
git config --local user.email "${{ secrets.GIT_USERNAME }}"
git config --local user.name "${{ secrets.ALT_GIT_EMAIL }}"
mkdir -p ${{github.workspace}}/docs/
mv -f *.midi ${{github.workspace}}/docs/
mv -f *.pdf ${{github.workspace}}/docs/
mv -f *.png ${{github.workspace}}/docs/
git add ${{github.workspace}}/docs/
git commit -m "Add changes" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
name: 'Lilypond Generator'
description: 'Run Lilypond tool with the given set of arguments to generate music sheets'
author: '@alexandre-touret'
inputs:
args:
description: 'Arguments for Lilyponid'
required: true
default: '-h'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.args }}
branding:
icon: 'underline'
color: 'blue'