From 4f8e7d3fb76c83cb3c7579ae9454f0053d78dad5 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Wed, 23 Apr 2025 10:54:33 -0500 Subject: [PATCH 1/7] update devcontainer --- .devcontainer.json | 88 --------------------------------- .devcontainer/devcontainer.json | 80 ++++++++++++++++++++++++++++++ .devcontainer/installLatex.sh | 29 +++++++++++ .devcontainer/installPretext.sh | 27 ++++++++++ 4 files changed, 136 insertions(+), 88 deletions(-) delete mode 100644 .devcontainer.json create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/installLatex.sh create mode 100644 .devcontainer/installPretext.sh diff --git a/.devcontainer.json b/.devcontainer.json deleted file mode 100644 index 87acf06..0000000 --- a/.devcontainer.json +++ /dev/null @@ -1,88 +0,0 @@ -// This file was automatically generated with PreTeXt 2.15.1. -// If you modify this file, PreTeXt will no longer automatically update it. -// -////////////////////////////////////////////////////////////// -// -// This file provides configuration options so that a PreTeXt -// project can be edited and built using GitHub's Codespaces. -// It is recommended to keep this in your repository even if you -// do not use this feature, as it will allow other to explore -// your project easily. -// This file will be automatically generated by PreTeXt with the -// latest updates unless you remove the first comment line above. -// -/////////////////////////////////////////////////////////////// -{ - "name": "PreTeXt-Codespaces", - - // This Docker image includes some LaTeX support, but is still not to large. Note that if you keep your codespace running, it will use up your GitHub free storage quota. Additional options are listed below. - // "image": "oscarlevin/pretext:small", - // If you need to generate more complicated assets (such as sageplots) or use additional fonts when building to PDF, comment out the above line and uncomment the following line. - "image": "oscarlevin/pretext:full", - // If you only intend to build for web and don't have any latex-image generated assets, you can use a smaller image: - // "image": "oscarlevin/pretext:lite", - - // Add gh cli as a feature (to support codechat) - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {} - }, - - // Respect the project's designated dependencies - "postCreateCommand": "pip install -r requirements.txt", - - // Port forwarding - // --------------- - // This is needed by the CodeChat Server. - "forwardPorts": [ - // The port used for a Thrift connection between the VSCode CodeChat - // extension and the CodeChat Server. - 27376, - // The port used for an HTTP connection from the CodeChat Client to - // the CodeChat Server. - 27377, - // The port used by a websocket connection between the CodeChat - // Server and the CodeChat Client. - 27378 - ], - // See the [docs](https://containers.dev/implementors/json_reference/#port-attributes). - "portsAttributes": { - "27376": { - "label": "VSCode extension <-> CodeChat Server", - "requireLocalPort": true - }, - "27377": { - "label": "CodeChat Client", - "requireLocalPort": true - }, - "27378": { - "label": "CodeChat Client<->Server websocket", - "requireLocalPort": true - // This port needs to be public; however, there's no way to specify port visibility here. See `server.py` in the CodeChat Server for details. - } - }, - - // Configure tool-specific properties. - "customizations": { - "codespaces": { - "openFiles": ["source/main.ptx"] - }, - "vscode": { - "settings": { - "editor.quickSuggestions": { - "other": "off" - }, - "editor.snippetSuggestions": "top", - "xml.validation.enabled": false, - "CodeChat.CodeChatServer.Command": "CodeChat_Server" - }, - "extensions": [ - "ms-vscode.live-server", - "oscarlevin.pretext-tools", - "CodeChat.codechat" - ] - } - } - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f4626c0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,80 @@ +// This file was automatically generated with PreTeXt 2.17.0. +// If you modify this file, PreTeXt will no longer automatically update it. +// +////////////////////////////////////////////////////////////// +// +// This file provides configuration options so that a PreTeXt +// project can be edited and built using GitHub's Codespaces. +// It is recommended to keep this in your repository even if you +// do not use this feature, as it will allow other to explore +// your project easily. +// This file will be automatically generated by PreTeXt with the +// latest updates unless you remove the first comment line above. +// +/////////////////////////////////////////////////////////////// +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": {}, + + // Comment or uncomment lines below if you don't or do need that feature. + "postCreateCommand": { + // "install sagemath": "bash ./.devcontainer/installSage.sh", + // "install pandoc": "bash ./.devcontainer/installPandoc.sh", + "install latex": "bash ./.devcontainer/installLatex.sh", + "install pretext": "bash ./.devcontainer/installPretext.sh" + }, + + + // Port forwarding + // --------------- + // This is needed by the CodeChat Server. + "forwardPorts": [ + // The port used for a Thrift connection between the VSCode CodeChat + // extension and the CodeChat Server. + 27376, + // The port used for an HTTP connection from the CodeChat Client to + // the CodeChat Server. + 27377, + // The port used by a websocket connection between the CodeChat + // Server and the CodeChat Client. + 27378 + ], + // See the [docs](https://containers.dev/implementors/json_reference/#port-attributes). + "portsAttributes": { + "27376": { + "label": "VSCode extension <-> CodeChat Server", + "requireLocalPort": true + }, + "27377": { + "label": "CodeChat Client", + "requireLocalPort": true + }, + "27378": { + "label": "CodeChat Client<->Server websocket", + "requireLocalPort": true + // This port needs to be public; however, there's no way to specify port visibility here. See `server.py` in the CodeChat Server for details. + } + }, + + + // Configure tool-specific properties. + "customizations": { + "codespaces": { + "openFiles": ["source/main.ptx"] + }, + "vscode": { + "settings": { + "editor.quickSuggestions": { + "other": "off" + }, + "editor.snippetSuggestions": "top", + "xml.validation.enabled": false, + "CodeChat.CodeChatServer.Command": "CodeChat_Server" + }, + "extensions": [ + "oscarlevin.pretext-tools", + "CodeChat.codechat" + ] + } + } + } diff --git a/.devcontainer/installLatex.sh b/.devcontainer/installLatex.sh new file mode 100644 index 0000000..9401c00 --- /dev/null +++ b/.devcontainer/installLatex.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# This file was automatically generated with PreTeXt 2.17.0. +# If you modify this file, PreTeXt will no longer automatically update it. + +# We use TinyTeX (https://yihui.org/tinytex/) +wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh + +tlmgr install adjustbox amscdx bold-extra braket bussproofs cancel carlisle cases chessfss circuitikz colortbl enumitem extpfeil fontawesome5 fontaxes gensymb imakeidx jknapltx kastrup lambda-lists listings listingsutf8 marvosym mathalpha mathtools menukeys mhchem microtype musicography newpx newtx nicematrix pdfcol pdfpages pdflscape pgfplots phaistos physics polyglossia pstricks realscripts relsize siunitx skak skaknew smartdiagram snapshot stmaryrd tcolorbox tikzfill titlesec txfonts ulem upquote was xfrac xltxtra xpatch xstring + +tlmgr path add + +# Ensure fonts provided by TinyTeX are available, as suggested in the pretext guide +fontconfig=" + + + ~/.TinyTeX/texmf-dist/fonts + ~/.TinyTeX/texmf-local/fonts +" + +fontconfig_path="/etc/fonts/conf.d/09-texlive-fonts.conf" +if [ ! -f "$fontconfig_path" ]; then + echo "Creating fontconfig file at $fontconfig_path" + echo "$fontconfig" | sudo tee "$fontconfig_path" > /dev/null +else + echo "Fontconfig file already exists at $fontconfig_path" +fi +# Update font cache +fc-cache -f -v diff --git a/.devcontainer/installPretext.sh b/.devcontainer/installPretext.sh new file mode 100644 index 0000000..4b52aee --- /dev/null +++ b/.devcontainer/installPretext.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# This file was automatically generated with PreTeXt 2.17.0. +# If you modify this file, PreTeXt will no longer automatically update it. + +sudo apt-get update +sudo apt-get install -y --no-install-recommends \ + python3-louis \ + libcairo2-dev \ + librsvg2-bin + +pip install --upgrade pip --break-system-packages + +pip install pretext[homepage,prefigure] --only-binary {greenlet} --break-system-packages + +pip install codechat-server --break-system-packages + +playwright install-deps + +playwright install + +# Install mermaid for diagrams +npm install -g @mermaid-js/mermaid-cli + +# echo '/usr/lib/python3/dist-packages' > /usr/local/lib/python3.8/dist-packages/louis.pth + +prefig init From b96a500deb793b44b0ae2677bd35b88375560fc9 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Wed, 23 Apr 2025 16:10:49 +0000 Subject: [PATCH 2/7] update pretext and generate boilerplate --- .devcontainer/devcontainer.json | 161 ++++++++++++++------------- .devcontainer/installLatex.sh | 4 +- .devcontainer/installPandoc.sh | 17 +++ .devcontainer/installPretext.sh | 2 +- .devcontainer/installSage.sh | 21 ++++ .github/workflows/pretext-cli.yml | 26 +++-- .github/workflows/pretext-deploy.yml | 64 +++++++++++ .gitignore | 2 +- project.ptx | 2 +- requirements.txt | 4 +- 10 files changed, 205 insertions(+), 98 deletions(-) create mode 100644 .devcontainer/installPandoc.sh create mode 100644 .devcontainer/installSage.sh create mode 100644 .github/workflows/pretext-deploy.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f4626c0..5d5b3f0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,80 +1,81 @@ -// This file was automatically generated with PreTeXt 2.17.0. -// If you modify this file, PreTeXt will no longer automatically update it. -// -////////////////////////////////////////////////////////////// -// -// This file provides configuration options so that a PreTeXt -// project can be edited and built using GitHub's Codespaces. -// It is recommended to keep this in your repository even if you -// do not use this feature, as it will allow other to explore -// your project easily. -// This file will be automatically generated by PreTeXt with the -// latest updates unless you remove the first comment line above. -// -/////////////////////////////////////////////////////////////// -{ - "image": "mcr.microsoft.com/devcontainers/universal:2", - "features": {}, - - // Comment or uncomment lines below if you don't or do need that feature. - "postCreateCommand": { - // "install sagemath": "bash ./.devcontainer/installSage.sh", - // "install pandoc": "bash ./.devcontainer/installPandoc.sh", - "install latex": "bash ./.devcontainer/installLatex.sh", - "install pretext": "bash ./.devcontainer/installPretext.sh" - }, - - - // Port forwarding - // --------------- - // This is needed by the CodeChat Server. - "forwardPorts": [ - // The port used for a Thrift connection between the VSCode CodeChat - // extension and the CodeChat Server. - 27376, - // The port used for an HTTP connection from the CodeChat Client to - // the CodeChat Server. - 27377, - // The port used by a websocket connection between the CodeChat - // Server and the CodeChat Client. - 27378 - ], - // See the [docs](https://containers.dev/implementors/json_reference/#port-attributes). - "portsAttributes": { - "27376": { - "label": "VSCode extension <-> CodeChat Server", - "requireLocalPort": true - }, - "27377": { - "label": "CodeChat Client", - "requireLocalPort": true - }, - "27378": { - "label": "CodeChat Client<->Server websocket", - "requireLocalPort": true - // This port needs to be public; however, there's no way to specify port visibility here. See `server.py` in the CodeChat Server for details. - } - }, - - - // Configure tool-specific properties. - "customizations": { - "codespaces": { - "openFiles": ["source/main.ptx"] - }, - "vscode": { - "settings": { - "editor.quickSuggestions": { - "other": "off" - }, - "editor.snippetSuggestions": "top", - "xml.validation.enabled": false, - "CodeChat.CodeChatServer.Command": "CodeChat_Server" - }, - "extensions": [ - "oscarlevin.pretext-tools", - "CodeChat.codechat" - ] - } - } - } +// This file was automatically generated with PreTeXt 2.17.1. +// If you modify this file, PreTeXt will no longer automatically update it. +// +////////////////////////////////////////////////////////////// +// +// This file provides configuration options so that a PreTeXt +// project can be edited and built using GitHub's Codespaces. +// It is recommended to keep this in your repository even if you +// do not use this feature, as it will allow other to explore +// your project easily. +// This file will be automatically generated by PreTeXt with the +// latest updates unless you remove the first comment line above. +// +/////////////////////////////////////////////////////////////// +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": {}, + + // Comment or uncomment lines below if you don't or do need that feature. + "postCreateCommand": { + // "install sagemath": "bash ./.devcontainer/installSage.sh", + // "install pandoc": "bash ./.devcontainer/installPandoc.sh", + "install latex": "bash ./.devcontainer/installLatex.sh", + "install pretext": "bash ./.devcontainer/installPretext.sh", + "mark repo as safe": "git config --global --add safe.directory $(pwd)" + }, + + + // Port forwarding + // --------------- + // This is needed by the CodeChat Server. + "forwardPorts": [ + // The port used for a Thrift connection between the VSCode CodeChat + // extension and the CodeChat Server. + 27376, + // The port used for an HTTP connection from the CodeChat Client to + // the CodeChat Server. + 27377, + // The port used by a websocket connection between the CodeChat + // Server and the CodeChat Client. + 27378 + ], + // See the [docs](https://containers.dev/implementors/json_reference/#port-attributes). + "portsAttributes": { + "27376": { + "label": "VSCode extension <-> CodeChat Server", + "requireLocalPort": true + }, + "27377": { + "label": "CodeChat Client", + "requireLocalPort": true + }, + "27378": { + "label": "CodeChat Client<->Server websocket", + "requireLocalPort": true + // This port needs to be public; however, there's no way to specify port visibility here. See `server.py` in the CodeChat Server for details. + } + }, + + + // Configure tool-specific properties. + "customizations": { + "codespaces": { + "openFiles": ["source/main.ptx"] + }, + "vscode": { + "settings": { + "editor.quickSuggestions": { + "other": "off" + }, + "editor.snippetSuggestions": "top", + "xml.validation.enabled": false, + "CodeChat.CodeChatServer.Command": "CodeChat_Server" + }, + "extensions": [ + "oscarlevin.pretext-tools", + "CodeChat.codechat" + ] + } + } +} diff --git a/.devcontainer/installLatex.sh b/.devcontainer/installLatex.sh index 9401c00..6f7eb92 100644 --- a/.devcontainer/installLatex.sh +++ b/.devcontainer/installLatex.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This file was automatically generated with PreTeXt 2.17.0. +# This file was automatically generated with PreTeXt 2.17.1. # If you modify this file, PreTeXt will no longer automatically update it. # We use TinyTeX (https://yihui.org/tinytex/) @@ -26,4 +26,4 @@ else echo "Fontconfig file already exists at $fontconfig_path" fi # Update font cache -fc-cache -f -v +fc-cache -f -v \ No newline at end of file diff --git a/.devcontainer/installPandoc.sh b/.devcontainer/installPandoc.sh new file mode 100644 index 0000000..c87a43f --- /dev/null +++ b/.devcontainer/installPandoc.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# This file was automatically generated with PreTeXt 2.17.1. +# If you modify this file, PreTeXt will no longer automatically update it. + +wget https://github.com/jgm/pandoc/releases/download/3.6.4/pandoc-3.6.4-1-amd64.deb -O pandoc.deb + +# wait for 60 second and then double check that no other script is using apt-get: +sleep 60 +while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do + echo "Waiting for apt-get to be free..." + sleep 15 +done +# Install pandoc +sudo apt-get install -y --no-install-recommends ./pandoc.deb + +rm pandoc.deb diff --git a/.devcontainer/installPretext.sh b/.devcontainer/installPretext.sh index 4b52aee..07b6892 100644 --- a/.devcontainer/installPretext.sh +++ b/.devcontainer/installPretext.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This file was automatically generated with PreTeXt 2.17.0. +# This file was automatically generated with PreTeXt 2.17.1. # If you modify this file, PreTeXt will no longer automatically update it. sudo apt-get update diff --git a/.devcontainer/installSage.sh b/.devcontainer/installSage.sh new file mode 100644 index 0000000..9e62177 --- /dev/null +++ b/.devcontainer/installSage.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# This file was automatically generated with PreTeXt 2.17.1. +# If you modify this file, PreTeXt will no longer automatically update it. + +# Conda should already be installed in the codespace. We need to add the conda-forge channel + +conda config --add channels conda-forge +conda config --set channel_priority strict + +# We don't want conda to open the base environment always: +conda config --set auto_activate_base false + +# Now create a conda environment for sage (called sage): +conda create --yes -n sage sage python=3.12 + +conda init + +echo 'conda activate sage' >> ~/.bashrc + +source ~/.bashrc diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index 880a287..74d3c8d 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -1,14 +1,20 @@ -# This file was automatically generated with PreTeXt 2.15.1. +# This file was automatically generated with PreTeXt 2.17.1. # If you modify this file, PreTeXt will no longer automatically update it. # +# This workflow file can be used to automatically build a project and create +# an artifact for deployment. It can also be used to deploy the project to +# GitHub Pages or Cloudflare Pages. +# +# The workflow is triggered on pull requests or can be run manually. You can uncomment +# the `push` event to have it run on pushes to the main branch as well. name: PreTeXt-CLI Actions on: # Runs on pull requests pull_request: branches: ["*"] - # Runs on pushes to main - push: - branches: ["main"] + ## Runs on pushes to main + #push: + # branches: ["main"] # Runs on demand workflow_dispatch: @@ -22,16 +28,14 @@ jobs: uses: actions/checkout@v4 - name: install deps - run: | - eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" - conda activate sage - pip install -r requirements.txt + run: pip install -r requirements.txt + + - name: install local ptx files + run: pretext --version - name: build deploy targets run: | - eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" - conda activate sage - version="$(pretext --version)" # also installs local ptx files + version="$(pretext --version)" major="$(echo $version | cut -d '.' -f 1)" minor="$(echo $version | cut -d '.' -f 2)" if [ "$major" -ge 2 -a "$minor" -ge 5 ]; then diff --git a/.github/workflows/pretext-deploy.yml b/.github/workflows/pretext-deploy.yml new file mode 100644 index 0000000..1a86526 --- /dev/null +++ b/.github/workflows/pretext-deploy.yml @@ -0,0 +1,64 @@ +# This file was automatically generated with PreTeXt 2.17.1. +# If you modify this file, PreTeXt will no longer automatically update it. +# + +name: Build and Deploy +on: + # Currently, this workflow only runs when manually selected (the `workflow_dispatch` event). + # If you would like it to run on other events, uncomment some of the lines below. + + # # Runs on pull requests + # pull_request: + # branches: ["*"] + + # # Runs on pushes to main + # push: + # branches: ["main"] + + # # Runs every day at 00:00 UTC + # schedule: + # - cron: '0 0 * * *' + + # Runs on demand + workflow_dispatch: + +permissions: + contents: write + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + container: oscarlevin/pretext:small + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: add gh-cli + run: | + apt-get update + apt-get install gh jq -y + + - name: setup git config + run: | + git config --global --add safe.directory $(pwd) + git config user.name "${{ github.actor }} via GitHub Actions" + git config user.email "${{ github.actor }}@github_actions.no_reply" + + - name: install deps + run: pip install -r requirements.txt --break-system-packages + + - name: install local ptx files + run: pretext --version + + - name: build deploy targets + run: pretext build --deploys + + - name: run deploy + run: pretext deploy --no-push + + - name: push gh-pages branch + run: git push origin gh-pages --force + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/.gitignore b/.gitignore index b8c3814..dc41491 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# This file was automatically generated with PreTeXt 2.15.1. +# This file was automatically generated with PreTeXt 2.17.1. # If you modify this file, PreTeXt will no longer automatically update it. # # Boilerplate list of files in a PreTeXt project for git to ignore diff --git a/project.ptx b/project.ptx index 427f538..2e4755c 100644 --- a/project.ptx +++ b/project.ptx @@ -1,5 +1,5 @@ - + diff --git a/requirements.txt b/requirements.txt index 4e2a1b0..dd9ebea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -# This file was automatically generated with PreTeXt 2.15.1. -pretext == 2.15.1 +# This file was automatically generated with PreTeXt 2.17.1. +pretext == 2.17.1 From 61327fa842681c749342a0ccbca51b4f69b94bbb Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Wed, 23 Apr 2025 17:46:15 +0000 Subject: [PATCH 3/7] try using basic image --- .devcontainer/devcontainer.json | 2 +- .github/workflows/pretext-cli.yml | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5d5b3f0..46a74fc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,7 +18,7 @@ // Comment or uncomment lines below if you don't or do need that feature. "postCreateCommand": { - // "install sagemath": "bash ./.devcontainer/installSage.sh", + "install sagemath": "bash ./.devcontainer/installSage.sh", // "install pandoc": "bash ./.devcontainer/installPandoc.sh", "install latex": "bash ./.devcontainer/installLatex.sh", "install pretext": "bash ./.devcontainer/installPretext.sh", diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index 74d3c8d..70c7434 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -21,14 +21,17 @@ on: jobs: build: runs-on: ubuntu-latest - container: oscarlevin/pretext:full steps: - name: Checkout source uses: actions/checkout@v4 - - name: install deps - run: pip install -r requirements.txt + - name: Install the things + run: | + bash ./.devcontainer/installSage.sh + bash ./.devcontainer/installLatex.sh", + bash ./.devcontainer/installPretext.sh", + git config --global --add safe.directory $(pwd)" - name: install local ptx files run: pretext --version From 50350bb57a333fadd6c526348173eaaf174fbb32 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Wed, 23 Apr 2025 17:49:17 +0000 Subject: [PATCH 4/7] typos --- .github/workflows/pretext-cli.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index 70c7434..da7644c 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -29,9 +29,9 @@ jobs: - name: Install the things run: | bash ./.devcontainer/installSage.sh - bash ./.devcontainer/installLatex.sh", - bash ./.devcontainer/installPretext.sh", - git config --global --add safe.directory $(pwd)" + bash ./.devcontainer/installLatex.sh + bash ./.devcontainer/installPretext.sh + git config --global --add safe.directory $(pwd) - name: install local ptx files run: pretext --version From cec75e8fea0fafcf0e4728e936feb70b1bf2aeaa Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Wed, 23 Apr 2025 17:59:55 +0000 Subject: [PATCH 5/7] try sorucing bashrc --- .github/workflows/pretext-cli.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index da7644c..3b10b35 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -38,6 +38,7 @@ jobs: - name: build deploy targets run: | + source ~/.bashrc version="$(pretext --version)" major="$(echo $version | cut -d '.' -f 1)" minor="$(echo $version | cut -d '.' -f 2)" From c7c6374cc03f71d861477b49ebc165c358591233 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Wed, 23 Apr 2025 18:36:21 +0000 Subject: [PATCH 6/7] throw things at the wall --- .github/workflows/pretext-cli.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index 3b10b35..fa893ea 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -38,7 +38,10 @@ jobs: - name: build deploy targets run: | + cat ~/.bashrc source ~/.bashrc + eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" + conda activate sage version="$(pretext --version)" major="$(echo $version | cut -d '.' -f 1)" minor="$(echo $version | cut -d '.' -f 2)" From 92732a6ab980a4f12f02d2838ed6306b348208d6 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Thu, 24 Apr 2025 14:45:39 +0000 Subject: [PATCH 7/7] attempt to tidy up --- .devcontainer/installSage.sh | 3 ++- .github/workflows/pretext-cli.yml | 22 ++++++---------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.devcontainer/installSage.sh b/.devcontainer/installSage.sh index 9e62177..7166c09 100644 --- a/.devcontainer/installSage.sh +++ b/.devcontainer/installSage.sh @@ -18,4 +18,5 @@ conda init echo 'conda activate sage' >> ~/.bashrc -source ~/.bashrc +eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" +conda activate sage diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index fa893ea..64eeec4 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -33,27 +33,17 @@ jobs: bash ./.devcontainer/installPretext.sh git config --global --add safe.directory $(pwd) - - name: install local ptx files - run: pretext --version - - name: build deploy targets run: | - cat ~/.bashrc - source ~/.bashrc eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" conda activate sage - version="$(pretext --version)" - major="$(echo $version | cut -d '.' -f 1)" - minor="$(echo $version | cut -d '.' -f 2)" - if [ "$major" -ge 2 -a "$minor" -ge 5 ]; then - echo "PreTeXt version is 2.5 or greater; using new build command" - pretext build --deploys - else - echo "PreTeXt version is less than 2.5, using old build command" - pretext build - fi + pretext build --deploys + - name: stage deployment - run: pretext deploy --stage-only + run: | + eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" + conda activate sage + pretext deploy --stage-only - name: Bundle output/stage as artifact uses: actions/upload-artifact@v4