all repos — min @ bbd2091933fd5352f2dab281bee77dec55349edb

A small but practical concatenative programming language.

Merge branch 'master' into next
h3rald h3rald@h3rald.com
Thu, 21 Jan 2021 14:16:54 +0100
commit

bbd2091933fd5352f2dab281bee77dec55349edb

parent

82e5d0eb5a7aadd582a4b3702d14baa2b434ad0d

6 files changed, 216 insertions(+), 7 deletions(-)

jump to
M .github/workflows/ci.yml.github/workflows/ci.yml

@@ -5,8 +5,10 @@ on:

# Triggers the workflow on push or pull request events but only for the master branch push: branches: [ master ] + tags-ignore: [ '**' ] pull_request: branches: [ master ] + tags-ignore: [ '**' ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch:
A .github/workflows/release.yml

@@ -0,0 +1,141 @@

+name: Release + +# Controls when the action will run. +on: + # Run only when a new tag is pushed + push: + tags: + - 'v*.*.*' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + + # First, build and package our different assets + package: + name: "Package" + + # Set up a matrix of different configurations: + # for now Linux and MacOS (Windows can obviously be added as well) + # Here, we could also add flags - under a different matrix key - + # for different builds: e.g. lite vs non-lite + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + + env: + CHOOSENIM_CHOOSE_VERSION: stable + CHOOSENIM_NO_ANALYTICS: 1 + + steps: + # Cancel other actions of the same type that might be already running + + - name: "Cancel similar actions in progress" + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{ github.token }} + + # Checks out the repository + - uses: actions/checkout@v2 + + # Install libraries + - name: install musl-gcc + run: sudo apt-get install -y musl-tools + if: matrix.os == 'ubuntu-latest' + + # Set path + - name: Update $PATH + run: echo "$HOME/.nimble/bin" >> $GITHUB_PATH + + # Install the compiler + - name: Install Nim + run: | + curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh + sh init.sh -y + + # Install dependencies + - name: Install nifty + run: nimble install -y nifty + + - name: Install deps + run: nifty install + + # Build for linux + - name: Build (Linux) + run: nim c -d:release -d:ssl --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --cpu:amd64 --os:linux -o:min min + if: matrix.os == 'ubuntu-latest' + + # Build for MacOS + - name: Build (MacOS) + run: nim c -d:release -d:ssl -o:min min + if: matrix.os == 'macos-latest' + + # Package the resulting binary (along with the license and readme file) + - name: Create artifact + run: | + install -m 0755 ./min . + tar czf min-${{runner.os}}.tar.gz min README.md LICENSE + + # And upload it, so that we can reuse all of them later as release assets + - name: Upload Artifact + uses: 'actions/upload-artifact@v1' + with: + name: min-${{runner.os}}.tar.gz + path: min-${{runner.os}}.tar.gz + + # Then, let's prepare our new release and upload the assets above + upload: + name: "Upload" + runs-on: ubuntu-latest + if: ${{ always() }} + + # This should run after all matrix job (for linux, mac, etc) above have finished + needs: [package] + + steps: + - name: "Cancel similar actions in progress" + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{ github.token }} + + # Download all of the previously created assets + # and put them in an ./assets folder + - uses: actions/download-artifact@v2 + with: + path: ./assets + + # That's just for debugging to make sure everything is in place + - name: Display structure of downloaded files + run: ls -R + + # Create a new release + - name: Create Release + id: create-release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + ${{ github.ref }} + draft: false + prerelease: false + + # Post all of the above assets (under ./assets) + # as part of the newly created release + - name: Upload Release Assets + id: upload-release-assets + uses: dwenegar/upload-release-assets@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.create-release.outputs.id }} + assets_path: ./assets + + # Celebrate! :)
A Dockerfile

@@ -0,0 +1,32 @@

+# use Alpine+Nim as a basis +FROM frolvlad/alpine-nim + +# install necessary packages +RUN apk update +RUN apk add curl git + +# clone repository +RUN git clone https://github.com/h3rald/min.git + +# install nifty +RUN nimble install -y nifty + +# set path to nifty +# (for some reason it doesn't pick it up by itself) +ENV PATH="/root/.nimble/pkgs/nifty-1.2.2:${PATH}" + +# install dependencies with nifty +RUN cd min && nifty install + +# build min +RUN cd min && nim c -d:release -d:ssl -o:min min + +# set our PATH to the min's location +ENV PATH="/min:${PATH}" + +# set our workdir to /home +# (where our local files will be mirrored) +WORKDIR /home + +# start up the main binary +ENTRYPOINT [ "/min/min" ]
M README.mdREADME.md

@@ -1,10 +1,14 @@

-min -===== -A tiny concatenative programming language and shell. +<p align="center"><img align="center" width="350" src="logo_darker.svg"/></p> +<p align="center"> + <b>A tiny concatenative<br>programming language and shell</b> + <br><br> + <img src="https://img.shields.io/badge/nim-powered-yellow.svg?link=https://nim-lang-org"> + <img src="https://img.shields.io/github/release/h3rald/min/all.svg"> + <img src="https://img.shields.io/github/license/h3rald/min.svg"> +</p> -For more info, go to <https://min-lang.org>. +--- + +► For more info, go to <https://min-lang.org>. -![nim](https://img.shields.io/badge/nim-powered-yellow.svg?link=https://nim-lang-org) -![release](https://img.shields.io/github/release/h3rald/min/all.svg) -![license](https://img.shields.io/github/license/h3rald/min.svg)
A logo.svg

@@ -0,0 +1,15 @@

+<svg width="588" height="588" xmlns="http://www.w3.org/2000/svg"> + <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ --> + <g> + <title>Layer 1</title> + <g id="widget" transform="rotate(-0.0926624983549118 294.3764648437568,302.3101196289116) matrix(7.224760791089692,0,0,7.224760791089692,1091.8911354197558,1091.8773791888611) "> + + <path d="m-110.235944,-85.470377l-36.91286,6.2079l36.91286,6.1644l36.61214,-6.1644l-36.61214,-6.2079z" fill="#36a631" id="svg_2"/> + <path d="m-110.235944,-91.847177l-36.91286,6.2079l36.91286,6.1644l36.61214,-6.1644l-36.61214,-6.2079z" fill="#6bbc57" id="svg_3"/> + <path d="m-110.235944,-97.842677l-36.91286,6.2079l36.91286,6.1644l36.61214,-6.1644l-36.61214,-6.2079z" fill="#8dd97f" id="svg_4"/> + <path d="m-147.148804,-129.159877l5.5719,0l0,2.2288q1.6097,-1.684 2.7489,-2.2784q1.2134,-0.6191 3.046,-0.6191q4.0861,0 6.4634,3.5661q2.625,-3.5661 7.1074,-3.5661q8.14741,0 8.14741,9.881l0,14.90805l-5.59672,0l0,-13.39746q0,-3.46699 -0.84199,-4.90329q-0.8667,-1.4611 -2.8479,-1.4611q-2.3031,0 -3.3555,1.7335q-1.0525,1.7335 -1.0525,5.57193l0,12.45642l-5.5967,0l0,-13.32317q0,-6.43868 -3.7147,-6.43868q-2.3526,0 -3.4298,1.7582q-1.0773,1.7583 -1.0773,5.54723l0,12.45642l-5.5719,0l0,-24.12035z" fill="#bde9b7" id="svg_5"/> + <path d="m-101.458794,-129.159877l0,24.12035l-5.57195,0l0,-24.12035l5.57195,0zm-6.41394,-10.0296q0,-1.461 1.06486,-2.5259q1.06487,-1.0649 2.55072,-1.0649q1.51062,0 2.57548,1.0649q1.06487,1.0401 1.06487,2.5507q0,1.5106 -1.06487,2.5755q-1.04009,1.0649 -2.55071,1.0649q-1.51062,0 -2.57549,-1.0649q-1.06486,-1.0649 -1.06486,-2.6003z" fill="#bde9b7" id="svg_6"/> + <path d="m-94.401004,-129.159877l5.5967,0l0,2.2288q2.9222,-2.8975 6.5873,-2.8975q4.21,0 6.5626,2.6498q2.0306,2.2536 2.0306,7.355l0,14.78425l-5.5967,0l0,-13.47175q0,-3.5661 -0.9906,-4.9281q-0.9658,-1.3868 -3.5165,-1.3868q-2.7736,0 -3.9375,1.8326q-1.1392,1.8078 -1.1392,6.31485l0,11.6392l-5.5967,0l0,-24.12035z" fill="#bde9b7" id="svg_7"/> + </g> + </g> +</svg>
A logo_darker.svg

@@ -0,0 +1,15 @@

+<svg width="588" height="588" xmlns="http://www.w3.org/2000/svg"> + <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ --> + <g> + <title>Layer 1</title> + <g id="widget" transform="rotate(-0.0926624983549118 294.3764648437568,302.3101196289116) matrix(7.224760791089692,0,0,7.224760791089692,1091.8911354197558,1091.8773791888611) "> + + <path d="m-110.235944,-85.470377l-36.91286,6.2079l36.91286,6.1644l36.61214,-6.1644l-36.61214,-6.2079z" fill="#64b558" id="svg_2"/> + <path d="m-110.235944,-91.847177l-36.91286,6.2079l36.91286,6.1644l36.61214,-6.1644l-36.61214,-6.2079z" fill="#4a923b" id="svg_3"/> + <path d="m-110.235944,-97.842677l-36.91286,6.2079l36.91286,6.1644l36.61214,-6.1644l-36.61214,-6.2079z" fill="#247b1f" id="svg_4"/> + <path d="m-147.148804,-129.159877l5.5719,0l0,2.2288q1.6097,-1.684 2.7489,-2.2784q1.2134,-0.6191 3.046,-0.6191q4.0861,0 6.4634,3.5661q2.625,-3.5661 7.1074,-3.5661q8.14741,0 8.14741,9.881l0,14.90805l-5.59672,0l0,-13.39746q0,-3.46699 -0.84199,-4.90329q-0.8667,-1.4611 -2.8479,-1.4611q-2.3031,0 -3.3555,1.7335q-1.0525,1.7335 -1.0525,5.57193l0,12.45642l-5.5967,0l0,-13.32317q0,-6.43868 -3.7147,-6.43868q-2.3526,0 -3.4298,1.7582q-1.0773,1.7583 -1.0773,5.54723l0,12.45642l-5.5719,0l0,-24.12035z" fill="#93cd8d" id="svg_5"/> + <path d="m-101.458794,-129.159877l0,24.12035l-5.57195,0l0,-24.12035l5.57195,0zm-6.41394,-10.0296q0,-1.461 1.06486,-2.5259q1.06487,-1.0649 2.55072,-1.0649q1.51062,0 2.57548,1.0649q1.06487,1.0401 1.06487,2.5507q0,1.5106 -1.06487,2.5755q-1.04009,1.0649 -2.55071,1.0649q-1.51062,0 -2.57549,-1.0649q-1.06486,-1.0649 -1.06486,-2.6003z" fill="#93cd8d" id="svg_6"/> + <path d="m-94.401004,-129.159877l5.5967,0l0,2.2288q2.9222,-2.8975 6.5873,-2.8975q4.21,0 6.5626,2.6498q2.0306,2.2536 2.0306,7.355l0,14.78425l-5.5967,0l0,-13.47175q0,-3.5661 -0.9906,-4.9281q-0.9658,-1.3868 -3.5165,-1.3868q-2.7736,0 -3.9375,1.8326q-1.1392,1.8078 -1.1392,6.31485l0,11.6392l-5.5967,0l0,-24.12035z" fill="#93cd8d" id="svg_7"/> + </g> + </g> +</svg>