diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index c746f95..348ccb8 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -1,7 +1,9 @@ -name: Build documentation +name: Build and Deploy Documentation on: push: + branches: + - main workflow_dispatch: env: @@ -19,32 +21,30 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Define instance id and artifacts id: define-ids run: | - INSTANCE=${INSTANCE#*/} - INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]') - ARTIFACT="starlasu-documentation-${INSTANCE_ID_UPPER}.zip" - ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip" - - # Print the values - echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER" - echo "ARTIFACT: $ARTIFACT" - echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT" - - # Set the environment variables and outputs - echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV - echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV - echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV - echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT - echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT + INSTANCE=${INSTANCE#*/} + INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]') + ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip" + ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip" + + # Print the values + echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER" + echo "ARTIFACT: $ARTIFACT" + echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT" + + # Set the environment variables and outputs + echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV + echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV + echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV + echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT + echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT - name: Build docs using Writerside Docker builder uses: JetBrains/writerside-github-action@v4 with: instance: ${{ env.INSTANCE }} - artifact: ${{ env.ARTIFACT }} docker-version: ${{ env.DOCKER_VERSION }} - name: Save artifact with build results @@ -52,7 +52,64 @@ jobs: with: name: docs path: | - artifacts/${{ env.ARTIFACT }} + artifacts/${{ steps.define-ids.outputs.artifact }} artifacts/report.json - artifacts/${{ env.ALGOLIA_ARTIFACT }} - retention-days: 7 \ No newline at end of file + artifacts/${{ steps.define-ids.outputs.algolia_artifact }} + retention-days: 7 + +# - name: Upload build artifact +# uses: actions/upload-artifact@v4 +# with: +# name: writerside-docs +# path: artifacts/ +# +# - name: Package Built Artifact +# run: | +# mkdir -p ./package +# cp artifacts/webHelpSTRUMENTA2-all.zip ./package/ +# cd ./package +# echo '{ "name": "writerside-docs", "version": "1.0.0" }' > package.json + + - name: Deploy to Netlify + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + run: | + # Install Netlify CLI + npm install -g netlify-cli + + # Unzip the generated artifact + mkdir -p extracted + unzip artifacts/${{ env.ARTIFACT }} -d extracted + + # Deploy extracted content to Netlify + netlify deploy --prod --dir extracted + + - name: Create Release + id: create-release + uses: actions/create-release@v1 + with: + tag_name: v${{ github.run_number }} + release_name: Documentation Build - ${{ github.run_number }} + body: | + ## Documentation Build + This release contains the built documentation artifacts for version ${{ github.run_number }}. + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install GitHub CLI + run: sudo apt-get install -y gh + + - name: Upload Artifact to Release + run: | + gh release upload v${{ github.run_number }} artifacts/${{ env.ARTIFACT }} --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Algolia Artifact to Release + run: | + gh release upload v${{ github.run_number }} artifacts/${{ env.ALGOLIA_ARTIFACT }} --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/Writerside/strumenta.tree b/Writerside/strumenta.tree index ba14d2b..08c642a 100644 --- a/Writerside/strumenta.tree +++ b/Writerside/strumenta.tree @@ -29,6 +29,7 @@ + diff --git a/Writerside/topics/TypeChecking.md b/Writerside/topics/TypeChecking.md new file mode 100644 index 0000000..54b47c9 --- /dev/null +++ b/Writerside/topics/TypeChecking.md @@ -0,0 +1,3 @@ +# Type Checking + +_To be written_. \ No newline at end of file diff --git a/Writerside/topics/usecases/building-parser.md b/Writerside/topics/usecases/building-parser.md index f674d8d..4fd3575 100644 --- a/Writerside/topics/usecases/building-parser.md +++ b/Writerside/topics/usecases/building-parser.md @@ -12,10 +12,10 @@ An initial version may also be generated from the ANTLR grammar, by using StarLa We then organize the parser into a pipeline: 1. First-stage parsing using ANTLR. We obtain a parse tree and, possibly, a series of errors. -2. Second-stage parsing. [The parse tree is mapped into the AST](../parsetree_to_ast.md) +2. Second-stage parsing. [The parse tree is mapped into the AST](ParseTreeToASTMapping.md) 3. Potentially, for some parsers, we perform additional steps, such as: - 1. [Symbol resolution](../symbol_resolution.md) - 2. [Type checking](../typesystem.md) + 1. [Symbol resolution](SymbolResolution.md) + 2. [Type checking](TypeChecking.md) 3. Advanced calculations such as lineage, data flow analysis, linting, etc. The StarLasu ASTs provide a more convenient API with respect to the ANTLR APIs for parse trees. In fact, StarLasu comes