Skip to content

Commit a842e60

Browse files
committed
Adding Github Action to build artifacts using LiaScript Exporter.
1 parent d551768 commit a842e60

17 files changed

Lines changed: 35702 additions & 1 deletion

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,45 @@ Learn more: https://scorm.com/scorm-explained/
8888
Known SCORM configurations per LMS:
8989
https://www.npmjs.com/package/@liascript/exporter#scorm-examples
9090

91+
## GitHub Action
92+
93+
Export your LiaScript courses directly in GitHub workflows with this GitHub Action.
94+
95+
### Quick Start
96+
97+
Add to your `.github/workflows/export.yml`:
98+
99+
```yaml
100+
name: Export Course
101+
on: [push]
102+
103+
jobs:
104+
export:
105+
runs-on: ubuntu-latest
106+
steps:
107+
- uses: actions/checkout@v4
108+
109+
- name: Export to SCORM
110+
uses: ./
111+
with:
112+
input-file: 'README.md'
113+
format: 'scorm1.2'
114+
output-name: 'my-course'
115+
scorm-organization: 'My Organization'
116+
117+
- name: Upload SCORM package
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: scorm-package
121+
path: '*.zip'
122+
```
123+
124+
### Documentation
125+
126+
For complete GitHub Action documentation, inputs, outputs, and more examples, see: [`action/README.md`](action/README.md)
127+
128+
## CLI Usage
129+
91130
--scorm-organization set the organization title
92131
--scorm-masteryScore set the scorm masteryScore (a value between 0
93132
-- 100), default is 0
@@ -204,7 +243,7 @@ overview page, based on a provided yaml description.
204243
Learn more: https://www.npmjs.com/package/@liascript/exporter#project
205244

206245
Example:
207-
- Input: https://github.com/LiaBooks/liabooks.github.com/blob/main/project.yaml
246+
- Input: https://github.com/LiaBooks/liabooks.github.com/blob/main/project.yml
208247
- Output: https://liabooks.github.io
209248

210249
--project-no-meta Disable the generation of meta information

action.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: 'LiaScript-Exporter'
2+
description: 'Export LiaScript courses to SCORM, PDF, Web, and other formats for LMS deployment and distribution'
3+
author: 'grugnog'
4+
branding:
5+
icon: 'book'
6+
color: 'blue'
7+
8+
inputs:
9+
# Core inputs
10+
input-file:
11+
description: 'Path to README.md or project.yml file'
12+
required: true
13+
format:
14+
description: 'Export format (scorm1.2, scorm2004, pdf, web, ims, xapi, rdf, json, project)'
15+
required: true
16+
output-name:
17+
description: 'Base name for output files'
18+
required: false
19+
course-path:
20+
description: 'Directory containing the course'
21+
required: false
22+
23+
# SCORM settings
24+
scorm-organization:
25+
description: 'Organization title'
26+
required: false
27+
scorm-mastery-score:
28+
description: 'Mastery score (0-100)'
29+
required: false
30+
default: '0'
31+
scorm-typical-duration:
32+
description: 'Duration (PT0H5M0S format)'
33+
required: false
34+
default: 'PT0H5M0S'
35+
scorm-iframe:
36+
description: 'Use iframe for SCORM'
37+
required: false
38+
default: 'false'
39+
scorm-embed:
40+
description: 'Embed Markdown in JS'
41+
required: false
42+
default: 'false'
43+
44+
# PDF settings
45+
pdf-theme:
46+
description: 'LiaScript theme'
47+
required: false
48+
default: 'default'
49+
pdf-format:
50+
description: 'Paper format'
51+
required: false
52+
default: 'A4'
53+
pdf-scale:
54+
description: 'Webpage rendering scale'
55+
required: false
56+
default: '1'
57+
pdf-landscape:
58+
description: 'Landscape orientation'
59+
required: false
60+
default: 'false'
61+
pdf-print-background:
62+
description: 'Print background graphics'
63+
required: false
64+
default: 'false'
65+
pdf-stylesheet:
66+
description: 'Custom CSS file path'
67+
required: false
68+
69+
# Web settings
70+
web-zip:
71+
description: 'Create zip archive'
72+
required: false
73+
default: 'true'
74+
web-indexeddb:
75+
description: 'Enable IndexedDB storage'
76+
required: false
77+
default: 'false'
78+
web-iframe:
79+
description: 'Use iframe version'
80+
required: false
81+
default: 'false'
82+
83+
# IMS settings
84+
ims-indexeddb:
85+
description: 'Use IndexedDB for persistence'
86+
required: false
87+
default: 'false'
88+
89+
# xAPI settings
90+
xapi-endpoint:
91+
description: 'LRS endpoint URL'
92+
required: false
93+
xapi-auth:
94+
description: 'Authentication string'
95+
required: false
96+
xapi-actor:
97+
description: 'xAPI actor JSON'
98+
required: false
99+
xapi-course-id:
100+
description: 'Course identifier'
101+
required: false
102+
xapi-course-title:
103+
description: 'Course title'
104+
required: false
105+
xapi-debug:
106+
description: 'Enable debug logging'
107+
required: false
108+
default: 'false'
109+
xapi-zip:
110+
description: 'Package as zip'
111+
required: false
112+
default: 'false'
113+
114+
# RDF settings
115+
rdf-format:
116+
description: 'Output format (json-ld, n-quads)'
117+
required: false
118+
default: 'json-ld'
119+
rdf-url:
120+
description: 'External URL reference'
121+
required: false
122+
rdf-type:
123+
description: 'Schema.org type'
124+
required: false
125+
default: 'Course'
126+
rdf-license:
127+
description: 'License URL'
128+
required: false
129+
rdf-educational-level:
130+
description: 'Educational level'
131+
required: false
132+
133+
# General settings
134+
style:
135+
description: 'Additional CSS styling'
136+
required: false
137+
responsive-voice-key:
138+
description: 'Text-to-speech API key'
139+
required: false
140+
141+
outputs:
142+
output-file:
143+
description: 'Path to the generated file'
144+
file-size:
145+
description: 'Size of generated file in bytes'
146+
format:
147+
description: 'Format that was generated'
148+
success:
149+
description: 'Whether export succeeded (true/false)'
150+
151+
runs:
152+
using: 'node20'
153+
main: 'action/dist/index.js'

action/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build outputs
8+
dist/*.d.ts
9+
dist/*.d.ts.map
10+
dist/*.js.map
11+
dist/sourcemap-register.js
12+
dist/licenses.txt
13+
14+
# Keep the main bundled file for GitHub Actions
15+
!dist/index.js
16+
17+
# IDE
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.swo
22+
23+
# OS
24+
.DS_Store
25+
Thumbs.db
26+
27+
# Test artifacts
28+
coverage/
29+
test-action.js
30+
31+
# Logs
32+
*.log

0 commit comments

Comments
 (0)