From 831026a8d710f9e737c938f68aef87f2261e9b4d Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 10:22:01 -0800 Subject: [PATCH 1/9] add release-ci, artifacts, etc. Signed-off-by: Ava Affine --- .gitlab-ci.yml | 13 ++++- snippets/artifacts/default_fleshrc.f | 65 +++++++++++++++++++++++++ snippets/artifacts/install.sh | 32 ++++++++++++ snippets/artifacts/release_contents.txt | 23 +++++++++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 snippets/artifacts/default_fleshrc.f create mode 100644 snippets/artifacts/install.sh create mode 100644 snippets/artifacts/release_contents.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e844dd..5a5be6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,10 +19,21 @@ compile-implicit-load: compile-release: stage: build script: - - cargo build --release + - cargo build -F implicit-load --release artifacts: paths: - target/release/flesh + - Readme.org + - Writing.org + - Shell.org + - snippets/flesh-mode.el + - snippets/genbind.f + - snippets/interactive-devel.f + - snippets/userlib.f + - LICENSE.md + - snippets/artifacts/default_fleshrc.f + - snippets/artifacts/release_contents.txt + - snippets/artifacts/install.sh only: variables: - $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+-?.*$/ diff --git a/snippets/artifacts/default_fleshrc.f b/snippets/artifacts/default_fleshrc.f new file mode 100644 index 0000000..13a6e30 --- /dev/null +++ b/snippets/artifacts/default_fleshrc.f @@ -0,0 +1,65 @@ +#!/usr/bin/env flesh + +(set (q CFG_FLESH_POSIX) true) +(set (q CFG_FLESH_ENV) true) + +(def snippets 'flesh conf snippets' (concat HOME "/.flesh/")) +(def _user_libraries 'flesh support libs' + ((concat snippets '/userlib.f') + (concat snippets '/genbind.f') + (concat snippets '/interactive-devel.f') + ;; add your own scripts here + )) + +(def loadlibs 'load all flesh libs' + (lambda () + (let ((lib-iter (pop _user_libraries))) + (while (gt? (len lib-iter) 1) + (let ((lib (car lib-iter)) + (next (cdr lib-iter))) + (call lib) + (def lib-iter '' (pop next))))))) +;(loadlibs) + +(def user-paths 'custom path entries' + ((concat HOME "/bin") + ;; add more here + )) + +;; add path if not already included +;; only you can stop $PATH pollution +(map + (lambda (entry) (if (not (contains? (get-paths) entry)) + (add-path entry) + ())) + user-paths) + +(def _fancy-cwd 'prints (up to) last three segments of current path' + () + (let ((cdir (load-to-string pwd)) + (dir-segs (split cdir '/')) + (dir-iter (dq dir-segs)) + (i 0)) + (if (lte? (len dir-segs) 4) + cdir + (let ((final "")) + (while (lt? i 3) + (set (q final) (concat "/" (car dir-iter) final)) + (set (q dir-iter) (dq (cdr dir-iter))) + (inc i)) + (concat "..." final))))) + +;; (def CFG_FLESH_CD_CB "directory based configs" ....... ) +(def CFG_FLESH_L_PROMPT "left prompt" () + (concat + "[" USER "]" "\t" + (_fancy-cwd) + "\n" ;; newline before delimiter + )) + +(def CFG_FLESH_R_PROMPT "right prompt" () + (concat + "(" (load-to-string date "+%H:%M") ")" )) + +(def CFG_FLESH_PROMPT_DELIMITER "delimiter" () + " -> ") diff --git a/snippets/artifacts/install.sh b/snippets/artifacts/install.sh new file mode 100644 index 0000000..168a946 --- /dev/null +++ b/snippets/artifacts/install.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +if [ ! "$USER" == "root" ]; then + echo you will likely need root to place in /bin. + echo comment out this test to continue without it + exit +fi + +if [ ! -n "$SUDO_USER" ]; then + echo SUDO_USER not set, so I dont know where to install to + exit +fi + +libdir=/home/$SUDO_USER/.flesh/ + +if [ ! -d "$libdir" ]; then + mkdir $libdir +fi + +if [ -d "/home/$SUDO_USER/.emacs.d" ]; then + mv flesh-mode.el /home/$SUDO_USER/.emacs.d/ + chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.emacs.d/flesh-mode.el +fi + +mv userlib.f $libdir +mv genbind.f $libdir +mv interactive-devel.f $libdir +mv default_fleshrc.f /home/$USER/.fleshrc +chown -R $SUDO_USER:$SUDO_USER $libdir + +mv flesh /bin/flesh +chmod +x /bin/flesh diff --git a/snippets/artifacts/release_contents.txt b/snippets/artifacts/release_contents.txt new file mode 100644 index 0000000..cf225ec --- /dev/null +++ b/snippets/artifacts/release_contents.txt @@ -0,0 +1,23 @@ +This file elaborates on the contents of this release zip + +1. LICENSE.md: A copy of the license these procedures are offered under +2. Readme.org: A snapshot of the readme at time of release +3. Writing.org: A snapshot of the language spec at time of release +4. Shell.org: A snapshot of the shell spec at time of release +5. flesh: A binary executable for the flesh interpreter + This binary will have been build with the + implicit-load flag +6. flesh-mode.el: A copy of the Emacs flesh mode +7. genbind.f: A snapshot of the genbind library, mostly included + as an example of metaprogramming in flesh. + +8. interactive-devel.f: A snapshot of the interactive development features. +9. userlib.f: A snapshot of the userlib at time of release +10: default_fleshrc.f: An example .fleshrc +11: install.sh An install script in shell for first time users. + this will overwrite .fleshrc with the example + this will install libraries to ~/.flesh/... + this will install flesh-mode.el in ~/.emacs.d if it exists + this will add the flesh binary to /bin/flesh + IT IS THE USER'S RESPONSIBILITY TO EDIT /etc/shells + Or to perform whatever tasks are desired to run flesh From a09d90559864e80d84ef2d725f59e05c2ace15c6 Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 10:48:27 -0800 Subject: [PATCH 2/9] update release ci --- .gitlab-ci.yml | 64 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a5be6d..93222ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,11 @@ default: image: rust:latest +stages: + - build + - test + - release + compile-with-posix-features: stage: build script: @@ -15,31 +20,7 @@ compile-implicit-load: stage: build script: - cargo build -F implicit-load - -compile-release: - stage: build - script: - - cargo build -F implicit-load --release - artifacts: - paths: - - target/release/flesh - - Readme.org - - Writing.org - - Shell.org - - snippets/flesh-mode.el - - snippets/genbind.f - - snippets/interactive-devel.f - - snippets/userlib.f - - LICENSE.md - - snippets/artifacts/default_fleshrc.f - - snippets/artifacts/release_contents.txt - - snippets/artifacts/install.sh - only: - variables: - - $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+-?.*$/ - except: - - branches - + unit-tests: stage: test script: @@ -49,3 +30,36 @@ userlib-tests: stage: test script: - cargo run --no-default-features snippets/userlib.f snippets/userlib-tests.f + +prepare-release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + script: + - cargo build -F implicit-load --release + - | + tar -czf flesh-$CI_COMMIT_TAG.tar.gz \ + target/release/flesh \ + Readme.org Writing.org Shell.org \ + snippets/flesh-mode.el \ + snippets/genbind.f \ + snippets/interactive-devel.f \ + snippets/userlib.f \ + LICENSE.md \ + snippets/release/default_fleshrc.f \ + snippets/release/release_contents.txt \ + snippets/release/install.sh + - echo $CI_COMMIT_TAG > VERSION + - echo $CI_JOB_ID > ID + artifacts: + paths: + - flesh-$CI_COMMIT_TAG.tar.gz + rules: + - if: '$CI_COMMIT_TAG =~ "/^v\d+.\d+.\d+/"' + release: + name: 'Release v$(cat VERSION)' + description: 'See releast_contents.txt' + tag_name: $CI_COMMIT_TAG + assets: + links: + - name: Get the release here + - url: https://gitlab.com/whom/relish/-/jobs/`cat ID`/artifacts/file/flesh-`cat VERSION`.tar.gz From 13219e1d5f7ee43aa31fee250ec09b1f60e4f74e Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 11:03:45 -0800 Subject: [PATCH 3/9] split release job into two Signed-off-by: Ava Affine --- .gitlab-ci.yml | 14 +++++++++++++- Readme.org | 2 -- snippets/{artifacts => release}/default_fleshrc.f | 0 snippets/{artifacts => release}/install.sh | 0 .../{artifacts => release}/release_contents.txt | 0 5 files changed, 13 insertions(+), 3 deletions(-) rename snippets/{artifacts => release}/default_fleshrc.f (100%) rename snippets/{artifacts => release}/install.sh (100%) rename snippets/{artifacts => release}/release_contents.txt (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93222ce..0b878b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,7 +33,6 @@ userlib-tests: prepare-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest script: - cargo build -F implicit-load --release - | @@ -53,6 +52,19 @@ prepare-release: artifacts: paths: - flesh-$CI_COMMIT_TAG.tar.gz + - VERSION + - ID + rules: + - if: '$CI_COMMIT_TAG =~ "/^v\d+.\d+.\d+/"' + +create-release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + needs: + - job: prepare-release + artifacts: true + script: + - echo "running job for release!" rules: - if: '$CI_COMMIT_TAG =~ "/^v\d+.\d+.\d+/"' release: diff --git a/Readme.org b/Readme.org index a8cab6a..cdea9ac 100644 --- a/Readme.org +++ b/Readme.org @@ -166,9 +166,7 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt - Can pass args to flesh scripts (via command line) - Can pass args to flesh scripts (via interpreter) - declare macros -- Release CI - Make an icon if you feel like it -- Post release to relevant channels ** TODO v1.1 tasks - all autocomplete is done via configurable userfunction, default documented with 1:1 functionality - Pipe also operates on stderr diff --git a/snippets/artifacts/default_fleshrc.f b/snippets/release/default_fleshrc.f similarity index 100% rename from snippets/artifacts/default_fleshrc.f rename to snippets/release/default_fleshrc.f diff --git a/snippets/artifacts/install.sh b/snippets/release/install.sh similarity index 100% rename from snippets/artifacts/install.sh rename to snippets/release/install.sh diff --git a/snippets/artifacts/release_contents.txt b/snippets/release/release_contents.txt similarity index 100% rename from snippets/artifacts/release_contents.txt rename to snippets/release/release_contents.txt From ca207fc4c91121b86b09c295fbe1f2aa3fd2d707 Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 11:27:55 -0800 Subject: [PATCH 4/9] fix link in create-release Signed-off-by: Ava Affine --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b878b3..2945cc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,10 +68,10 @@ create-release: rules: - if: '$CI_COMMIT_TAG =~ "/^v\d+.\d+.\d+/"' release: - name: 'Release v$(cat VERSION)' + name: 'Release $(cat VERSION)' description: 'See releast_contents.txt' tag_name: $CI_COMMIT_TAG assets: links: - name: Get the release here - - url: https://gitlab.com/whom/relish/-/jobs/`cat ID`/artifacts/file/flesh-`cat VERSION`.tar.gz + url: https://gitlab.com/whom/relish/-/jobs/`cat ID`/artifacts/file/flesh-`cat VERSION`.tar.gz From 6fd734beafa8cee63d137f7ab5f7d96fc38f2fb3 Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 11:39:46 -0800 Subject: [PATCH 5/9] fix link in create-release Signed-off-by: Ava Affine --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2945cc2..601e2b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,6 +37,9 @@ prepare-release: - cargo build -F implicit-load --release - | tar -czf flesh-$CI_COMMIT_TAG.tar.gz \ + --xform='s,target/release/,,' + --xform='s,snippets/,,' + --xform='s,snippets/release/,,' target/release/flesh \ Readme.org Writing.org Shell.org \ snippets/flesh-mode.el \ @@ -69,7 +72,7 @@ create-release: - if: '$CI_COMMIT_TAG =~ "/^v\d+.\d+.\d+/"' release: name: 'Release $(cat VERSION)' - description: 'See releast_contents.txt' + description: 'See release_contents.txt' tag_name: $CI_COMMIT_TAG assets: links: From c21aa911718174237a257b0a49ba3fe5c3f0daa2 Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 11:43:33 -0800 Subject: [PATCH 6/9] expand on description Signed-off-by: Ava Affine --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 601e2b2..0b54910 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,7 +72,7 @@ create-release: - if: '$CI_COMMIT_TAG =~ "/^v\d+.\d+.\d+/"' release: name: 'Release $(cat VERSION)' - description: 'See release_contents.txt' + description: 'This release was cut automatically from a git tag. See release_contents.txt for more information on the contents of the release.' tag_name: $CI_COMMIT_TAG assets: links: From 2694573391a100df36e17b020a0b876ffcd6a472 Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 11:48:55 -0800 Subject: [PATCH 7/9] add logo Signed-off-by: Ava Affine --- logo.png | Bin 0 -> 1337 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 logo.png diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9285dd2deb7ca95fdea3996efcc0083e43538bd1 GIT binary patch literal 1337 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGooCO|{#S9F3${@^GvDChdfq~_< zr;B4q#hkaZz4L{`MHrhg9G zr{0SF4rUQ}UHiCp+D_hJ^|4v^ zNvP8*p(Rt3=Y8~8$81$+$@%ww4ddHj`F&5;Y!h3_vc+k&%fjb}Bwy_L#aXJ=s2Iw* z$=m0*^NMYv4x60>V&AqsxnwO+Z=fJ^z4W8VlwIKp_7l`jnOK;JiapQ!pDR$Nv_33#8a3An#d zF!c%lQrChWJUIK1$9B&v!S^U3AH(wV$UC!7y>-xRDTNLBC zBjwyLFFYb_RCj>eVBNCIs}ieAOAD_vg-nWkwMAx0m0ON>#QWH7@tc%FIjdwTDHd=S cBF{9XZ-rjm?$>DmEDIStUHx3vIVCg!0DH1i{{R30 literal 0 HcmV?d00001 From 7eb832b35b1f992202a2cc6ce0b6beb047da23cf Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 11:51:16 -0800 Subject: [PATCH 8/9] fix typo in tar command Signed-off-by: Ava Affine --- .gitlab-ci.yml | 6 +++--- Readme.org | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b54910..6793d42 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,9 +37,9 @@ prepare-release: - cargo build -F implicit-load --release - | tar -czf flesh-$CI_COMMIT_TAG.tar.gz \ - --xform='s,target/release/,,' - --xform='s,snippets/,,' - --xform='s,snippets/release/,,' + --xform='s,target/release/,,' \ + --xform='s,snippets/,,' \ + --xform='s,snippets/release/,,' \ target/release/flesh \ Readme.org Writing.org Shell.org \ snippets/flesh-mode.el \ diff --git a/Readme.org b/Readme.org index cdea9ac..1e2e6f0 100644 --- a/Readme.org +++ b/Readme.org @@ -166,7 +166,6 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt - Can pass args to flesh scripts (via command line) - Can pass args to flesh scripts (via interpreter) - declare macros -- Make an icon if you feel like it ** TODO v1.1 tasks - all autocomplete is done via configurable userfunction, default documented with 1:1 functionality - Pipe also operates on stderr From 7119e9b8e3c1f3fc1252c70f8fd172754e27a01e Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 12:04:51 -0800 Subject: [PATCH 9/9] fix install script and release ci Signed-off-by: Ava Affine --- .gitlab-ci.yml | 1 + snippets/release/install.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6793d42..6a193d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,7 @@ prepare-release: --xform='s,target/release/,,' \ --xform='s,snippets/,,' \ --xform='s,snippets/release/,,' \ + --xform='s,release/,,' \ target/release/flesh \ Readme.org Writing.org Shell.org \ snippets/flesh-mode.el \ diff --git a/snippets/release/install.sh b/snippets/release/install.sh index 168a946..dd1e1ae 100644 --- a/snippets/release/install.sh +++ b/snippets/release/install.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ ! "$USER" == "root" ]; then +if [ "$USER" != "root" ]; then echo you will likely need root to place in /bin. echo comment out this test to continue without it exit @@ -25,8 +25,9 @@ fi mv userlib.f $libdir mv genbind.f $libdir mv interactive-devel.f $libdir -mv default_fleshrc.f /home/$USER/.fleshrc +mv default_fleshrc.f /home/$SUDO_USER/.fleshrc chown -R $SUDO_USER:$SUDO_USER $libdir +chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.fleshrc mv flesh /bin/flesh chmod +x /bin/flesh