1+ # File: .github/workflows/generate-liascript-outputs.yml
2+ name : Generate LiaScript Outputs
3+
4+ # Trigger: Run the workflow when changes are pushed to the 'main' branch.
5+ on :
6+ push :
7+ branches :
8+ - main
9+
10+ permissions :
11+ contents : write
12+
13+ jobs :
14+ generate :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ # Step 1: Check out the repository's code to project directory.
19+ - name : Checkout Repository
20+ uses : actions/checkout@v4
21+ with :
22+ path : project
23+
24+ # Step 2: Set up Node.js environment.
25+ - name : Set up Node.js
26+ uses : actions/setup-node@v3
27+ with :
28+ node-version : ' 22' # Specify the Node.js version.
29+
30+ # Step 3: Install the LiaScript exporter globally using npm.
31+ - name : Install LiaScript Exporter
32+ run : |
33+ npm install -g @liascript/exporter
34+
35+ # Step 4: Generate a PDF from README.md.
36+ - name : Generate PDF
37+ run : |
38+ liaex -i project/README.md --format pdf --output Documentation --pdf-timeout 50000
39+
40+ # Step 5: Generate a SCORM package.
41+ - name : Generate SCORM
42+ run : |
43+ liaex -i project/README.md -f scorm1.2 --scorm-masteryScore 80 --scorm-embed --output SCORM
44+
45+ # Step 6: Generate an IMS package.
46+ - name : Generate IMS Package
47+ run : |
48+ liaex -i project/README.md --format ims --output IMS
49+
50+ # Step 7: Create a new GitHub release for the generated assets.
51+ - name : Create New Release
52+ id : create_release
53+ uses : actions/create-release@v1
54+ env :
55+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ with :
57+ tag_name : ' latest'
58+ release_name : ' Latest LiaScript Documentation'
59+ draft : false
60+ prerelease : false
61+
62+ # Step 8: Upload the generated PDF as a release asset.
63+ - name : Upload PDF as Release Asset
64+ uses : actions/upload-release-asset@v1
65+ env :
66+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67+ with :
68+ upload_url : ${{ steps.create_release.outputs.upload_url }}
69+ asset_path : Documentation.pdf
70+ asset_name : Documentation.pdf
71+ asset_content_type : application/pdf
72+
73+ # Step 9: Upload the generated SCORM package.
74+ - name : Upload SCORM as Release Asset
75+ uses : actions/upload-release-asset@v1
76+ env :
77+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78+ with :
79+ upload_url : ${{ steps.create_release.outputs.upload_url }}
80+ asset_path : SCORM.zip
81+ asset_name : SCORM.zip
82+ asset_content_type : application/zip
83+
84+ # Step 10: Upload the generated IMS package.
85+ - name : Upload IMS as Release Asset
86+ uses : actions/upload-release-asset@v1
87+ env :
88+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89+ with :
90+ upload_url : ${{ steps.create_release.outputs.upload_url }}
91+ asset_path : IMS.zip
92+ asset_name : IMS.zip
93+ asset_content_type : application/zip
0 commit comments