Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Generate Docs

on:
workflow_dispatch:
push:
branches:
- main
on: [workflow_dispatch, push]

env:
node-version: 20.x
Expand All @@ -26,9 +22,23 @@ jobs:
- name: 😈 Automatically generating documentation...
run: |
npm install -g @madlib-lang/madlib
mv madlib_modules magic
madlib install
mv magic madlib_modules
madlib compile --bundle -i madlib_modules/MadDocCli/src/Main.mad -o build/src/maddoc-cli.js
node build/src/maddoc-cli.js src
echo "wrapEventHandler..."
grep _wrapEventHandler_ -m 1 .docs/bundle.js | cut -d" " -f4
EH_TRANSPILED_NAME=$(grep _wrapEventHandler_ -m 1 .docs/bundle.js | cut -d" " -f4)
echo "EventConstructors..."
grep _EventConstructors_ -m 1 .docs/bundle.js | cut -d" " -f4
EC_TRANSPILED_NAME=$(grep _EventConstructors_ -m 1 .docs/bundle.js | cut -d" " -f4)
echo "LIST TRANSPILED VARIABLE NAMES"
echo "event constructor: $EC_TRANSPILED_NAME"
echo "event handler: $EH_TRANSPILED_NAME"
sed -i "s/const handler = wrapEventHandler/const wrapEventHandler = $(echo $EH_TRANSPILED_NAME);\nconst EventConstructors = $(echo $EC_TRANSPILED_NAME);\nconst handler = wrapEventHandler/g" .docs/bundle.js
echo "LIST CONTENTS OF DOCS"
grep "handler = wrapEventHandler" -C5 .docs/bundle.js

- name: 🩺 Deploying documentation...
uses: JamesIves/github-pages-deploy-action@4.1.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'Publish new version'

on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish ( ex: v0.0.1 )'
required: true

env:
node-version: 14.x


jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
MADLIB_PKG_VERSION="v$(cat madlib.json | grep version | cut -d":" -f2 | cut -d"\"" -f2)"
TAG_NAME=${{ github.event.inputs.version }}
if [ "$TAG_NAME" = "$MADLIB_PKG_VERSION" ]; then
echo "Versions match"
else
echo "Versions in madlib.json is not ${TAG_NAME}"
exit 1
fi

release:
needs: check-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.node-version }}

- name: "Changelog: generate changelog"
id: changelog
uses: TriPSs/conventional-changelog-action@v3.4.1
with:
presets: "conventionalcommits"
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-on-empty: false
output-file: false
tag-prefix: 'v'
skip-commit: true
skip-version-file: true

- name: "Delete created tag from changelog"
run: |
git push --delete origin v${{ steps.changelog.outputs.version }}
git tag -d v${{ steps.changelog.outputs.version }}

- name: "Create Release"
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
body: ${{ steps.changelog.outputs.clean_changelog }}
draft: false
prerelease: false
11 changes: 11 additions & 0 deletions .github/workflows/madlib_modules/MadDoc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
madlib_modules
node_modules
/build
.DS_Store
.run
.docs
.tests
.coverage
documentation.json
_documentation.json
.module_cache
3 changes: 3 additions & 0 deletions .github/workflows/madlib_modules/MadDoc/.madlibignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
documentation.json
_documentation.json

13 changes: 13 additions & 0 deletions .github/workflows/madlib_modules/MadDoc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MadDoc
MadDoc is a document generator that takes as input the json file generated by `madlib doc` command.

## How to run it
```bash
madlib install
npm run dev
```
Currently, MadDoc frontend expects a doc file named `documentation.json` to be located in the `src/` folder. You can generate this one using the `madlib doc` command. Run `madlib doc --help` for more information.

## Note
This package is still under active development.

21 changes: 21 additions & 0 deletions .github/workflows/madlib_modules/MadDoc/madlib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "MadDoc",
"version": "0.0.6",
"madlibVersion": "0.14.0",
"main": "src/Main.mad",
"importAliases": {
".": "src"
},
"dependencies": [
{
"minVersion": "1.0.0",
"url": "https://github.com/madlib-lang/madmarkdown-renderer/archive/refs/tags/v1.0.0.zip",
"description": "MadMarkdownRenderer"
},
{
"minVersion": "3.0.0",
"url": "https://github.com/madlib-lang/madui/archive/refs/tags/v3.0.0.zip",
"description": "MadUI"
}
]
}
Loading