diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index 6cf6bf9..1772ba5 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -11,6 +11,10 @@ concurrency: group: publish-site-${{ github.ref }} cancel-in-progress: true +env: + MIX_ENV: docs + MIX_TARGET: ci + jobs: build-and-publish: name: Build and Publish Site @@ -40,7 +44,7 @@ jobs: uses: actions/cache@v4 with: path: deps - key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-env-${{ env.MIX_ENV }}-target-${{ env.MIX_TARGET }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} - name: Install mix dependencies if: steps.mix-deps-get-cache.outputs.cache-hit != 'true' @@ -51,14 +55,14 @@ jobs: uses: actions/cache@v4 with: path: _build - key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-env-${{ env.MIX_ENV }}-target-${{ env.MIX_TARGET }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} - name: Compile mix dependencies if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true' run: mix deps.compile - name: Build site - run: mix build + run: mix site.build - name: Upload built static site to Github Pages uses: actions/upload-pages-artifact@v3 diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index e15ef38..8619543 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -9,6 +9,7 @@ on: env: MIX_ENV: test + MIX_TARGET: ci concurrency: group: test-suite-${{ github.ref }} @@ -75,7 +76,7 @@ jobs: uses: actions/cache@v4 with: path: deps - key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-env-${{ env.MIX_ENV }}-target-${{ env.MIX_TARGET }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} - name: Install mix dependencies if: steps.mix-deps-get-cache.outputs.cache-hit != 'true' @@ -86,7 +87,7 @@ jobs: uses: actions/cache@v4 with: path: _build - key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-env-${{ env.MIX_ENV }}-target-${{ env.MIX_TARGET }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} - name: Compile mix dependencies if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true' @@ -97,7 +98,7 @@ jobs: uses: actions/cache@v4 with: path: priv/plts - key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-typecheck + key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-env-${{ env.MIX_ENV }}-target-${{ env.MIX_TARGET }}-mix-typecheck - name: Setup typechecking if: steps.mix-typecheck-cache.outputs.cache-hit != 'true' @@ -125,7 +126,7 @@ jobs: uses: actions/cache@v4 with: path: deps - key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-env-${{ env.MIX_ENV }}-target-${{ env.MIX_TARGET }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} - name: Install mix dependencies if: steps.mix-deps-get-cache.outputs.cache-hit != 'true' @@ -136,7 +137,7 @@ jobs: uses: actions/cache@v4 with: path: _build - key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: cache-${{ vars.CACHE_VERSION }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-env-${{ env.MIX_ENV }}-target-${{ env.MIX_TARGET }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} - name: Compile mix dependencies if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true' diff --git a/livebooks/surreal.livemd b/livebooks/surreal.livemd index d346194..074e94d 100644 --- a/livebooks/surreal.livemd +++ b/livebooks/surreal.livemd @@ -1,11 +1,15 @@ # Surreal Numbers in Elixir ```elixir +System.cmd("mix", ~w[hex.repo add christhekeele https://hex.chriskeele.com]) + Mix.install( [ - # {:livebook, "~> 0.0", repo: "chriskeele"}, - {:livebook, github: "christhekeele/livebooks", branch: "latest"} - # {:livebook, path: "/Users/keele/Projects/personal/livebooks"} + {:ets, "~> 0.9.0"}, + {:eternal, "~> 1.2"}, + # {:livebooks, github: "christhekeele/livebooks", branch: "latest"}, + {:livebook, "~> 0.0.1-dev", repo: "christhekeele"} + # {:livebooks, path: "/Users/keele/Projects/personal/livebooks"}, ], force: true ) @@ -36,12 +40,12 @@ end ## Axioms -- Zero -- One -- Negation -- Addition -- Multiplication -- Division +* Zero +* One +* Negation +* Addition +* Multiplication +* Division ```elixir zero = {[], []} diff --git a/mix.exs b/mix.exs index ff8ba4b..9bb70fa 100644 --- a/mix.exs +++ b/mix.exs @@ -3,6 +3,20 @@ defmodule Livebook.MixProject do @app :livebook @name "Chris Keele's Livebooks" + @maintainers ["Chris Keele"] + @licenses ["MIT"] + + @homepage_domain "livebooks.chriskeele.com" + @homepage_url "https://#{@homepage_domain}" + @github_url "https://github.com/christhekeele/livebooks" + @github_branch "latest" + + @title @name + @blurb "Elixir experiments, guides, and accompanying source code" + @description "#{@blurb} for #{@homepage_url}." + @blurb "#{@blurb}." + @splash_image "#{@homepage_url}/splash.jpg" + @authors ["Chris Keele"] @extras [ "livebooks/life.livemd": [ @@ -24,15 +38,6 @@ defmodule Livebook.MixProject do # Livebooks: ~r/^Livebooks\./ ] - @homepage_url "https://livebooks.chriskeele.com" - @github_url "https://github.com/christhekeele/livebooks" - @github_branch "latest" - - @description "My livebooks and supporting code for #{@homepage_url}." - @authors ["Chris Keele"] - @maintainers ["Chris Keele"] - @licenses ["MIT"] - @dev_envs [:dev, :test] @doc_envs [:dev, :docs] @@ -79,7 +84,7 @@ defmodule Livebook.MixProject do ] |> Map.new(&{&1, :test}) - doc_tasks = [:build, :docs, :static, :"hex.publish"] |> Map.new(&{&1, :docs}) + doc_tasks = [:"site.build", :docs, :static] |> Map.new(&{&1, :docs}) preferred_envs = %{} @@ -103,8 +108,11 @@ defmodule Livebook.MixProject do # Developer tools ### + # Build tasks + build: ["site.build", "hex.build"], + # Build through ex_doc - build: ["docs"], + "site.build": ["docs", "static"], # Combination clean utility clean: [ @@ -113,9 +121,6 @@ defmodule Livebook.MixProject do &clean_build_folders/1 ], - # Ensure hex.publish also adds static files - docs: ["docs", "static"], - # Installation tasks install: [ "install.rebar", @@ -192,7 +197,7 @@ defmodule Livebook.MixProject do api_reference: false, extra_section: "LIVEBOOKS", logo: "images/logo.png", - # cover: "docs/img/cover.png", + # cover: "images/livebooks.jpg", extras: @extras ++ [ @@ -237,6 +242,23 @@ defmodule Livebook.MixProject do + + + + + + + + + + + + + + + + + """ end, before_closing_body_tag: fn _ -> diff --git a/static/splash.jpg b/static/splash.jpg new file mode 100644 index 0000000..eb287ac Binary files /dev/null and b/static/splash.jpg differ