Skip to content

Commit e906e2e

Browse files
authored
Merge pull request #1 from runeflobakk/ga-build-pdf
Build PDF using GitHub Actions
2 parents 176d439 + 2715c41 commit e906e2e

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ indent_style = space
88
indent_size = 4
99
charset = utf-8
1010
continuation_indent_size = 8
11+
12+
[*.yml]
13+
indent_size = 2

.github/workflows/build-score.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build sheet music with LilyPond
2+
on: [push]
3+
jobs:
4+
build-sheet-music:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Check out repository
8+
uses: actions/checkout@v2
9+
- name: Set ly_revision environment variable
10+
run: echo "ly_revision=$(git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD)" >> $GITHUB_ENV
11+
- name: Echo ly_revision
12+
run: echo "${{ env.ly_revision }}"
13+
- name: Generate PDF music sheets
14+
uses: alexandre-touret/lilypond-github-action@master
15+
with:
16+
args: >
17+
--verbose
18+
--include=/github/workspace
19+
--output=/github/workspace/silent-night
20+
--pdf
21+
silent-night.ly
22+
- name: Release
23+
uses: softprops/action-gh-release@v1
24+
if: startsWith(github.ref, 'refs/tags/')
25+
with:
26+
files: silent-night.pdf
27+
fail_on_unmatched_files: true
28+

defs.ily

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
(stretchability . 60))
1111
}
1212

13+
revision = #(let
14+
((revision (getenv "ly_revision")))
15+
(if (not revision)
16+
(string-append "unknown (" (strftime "%FT%T%z" (localtime (current-time))) ")")
17+
revision
18+
)
19+
)
20+
1321
rit = \markup { \italic "rit." }
1422

1523
atempo = "a tempo"

silent-night.ly

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
% SPDX-License-Identifier: Apache-2.0 OR CC-BY-4.0
22

3-
\version "2.22.1"
3+
\version "2.22.0"
4+
#(use-modules (guile-user))
5+
46
\include "defs.ily"
57

68
\header {
@@ -9,8 +11,11 @@
911
arranger = "Rune Flobakk (arr.)"
1012
tagline = ##f
1113
instrument = "Piano"
12-
copyright = \markup {
13-
\copyrightSign "2022 Rune Flobakk " \emdash " Licensed under " \licenseCc
14+
copyright = \markup { \smaller
15+
\column {
16+
\center-align \line { \copyrightSign "2022 Rune Flobakk" \emdash "Licensed under" \licenseCc }
17+
\center-align \line { "Revision:" \revision }
18+
}
1419
}
1520
}
1621

0 commit comments

Comments
 (0)