From 2e41d2bf94a71fe406cb5aff18b66e4871bf08fc Mon Sep 17 00:00:00 2001 From: Steven Phillips Date: Tue, 24 Dec 2024 14:52:06 +0000 Subject: [PATCH] Improved docs of &which, changed mepinst to use simple jmp.idx format and a single latest release built by github action build-webpages Up'd version to 20241201 --- microemacs/contribs/github.emf | 38 ++++++++++++++++++++++++++++++++++ microemacs/doc/m4fil024.4 | 16 +++++++------- microemacs/macros/hkshell.emf | 2 +- microemacs/macros/mepinst.emf | 1 - microemacs/src/evers.mak | 4 ++-- 5 files changed, 50 insertions(+), 11 deletions(-) diff --git a/microemacs/contribs/github.emf b/microemacs/contribs/github.emf index 28108db8..12139cf4 100644 --- a/microemacs/contribs/github.emf +++ b/microemacs/contribs/github.emf @@ -77,6 +77,7 @@ set-variable $time 0 !emacro ; Build an action with given commit +; @# - if 0 don't download artifacts ; @1 - Commit SHA1 ; @2 - Name of action to build ; @3 - Full path to the artifact directory @@ -106,6 +107,7 @@ define-macro github-build-action !done !iif ¬ &seq "completed" #l3 -8 ml-write &spr "[Github %s Error: Unexpected state %s for run id %s]" #l0 #l3 #l5 !iif ¬ &seq "success" &set #l3 &rig ® "/json/ghaj/conclusion" "" 1 -8 ml-write &spr "[Github %s Error: Workflow run failed for run id %s, conclusion: %s]" #l0 #l5 + !iif ¬ @# !return github-api-json &spr "actions/runs/%s/artifacts" #l5 !iif &or ¬ &seq "[" &lef &set #l2 ® "/json/ghaj/artifacts" "" 1 &seq &set #l6 &rig #l2 1 "" -8 ml-write &spr "[Github %s Error: Unexpected artifacts array: %s]" #l0 #l2 set-variable #l3 0 @@ -161,6 +163,15 @@ define-macro github-build !force 0x100 file-op &cat #l1 "downloads" !force 0x100 file-op &cat #l1 "packages" ml-write &spr "[Github Build: Output to %s]" #l1 + find-file &cat #l1 "commit_sha.txt" + beginning-of-buffer + set-mark + end-of-buffer + -1 kill-region + insert-string #l0 + -1 buffer-mode "backup" + save-buffer + !force 0 delete-buffer $buffer-bname set-variable #l4 "" set-variable #l2 0 !while ¬ &seq "" &set #l3 &lget .git.hub-bal &inc #l2 1 @@ -181,6 +192,26 @@ define-macro github-release set-variable #l1 @3 !iif ¬ &seq "D" &stat t #l1 -8 ml-write &spr "[Github Release Error: Failed to locate given release directory - %s]" #l1 !iif ¬ &seq "D" &stat t &cat #l1 "downloads" -8 ml-write &spr "[Github Release Error: Failed to locate given release downloads directory - %sdownloads]" #l1 + !if ¬ &seq "R" &stat t &cat #l1 "downloads/Jasspa_MicroEmacs_Latest_packages.zip" + !iif ¬ &seq "D" &stat t &cat #l1 "packages" -8 ml-write &spr "[Github Release Error: Failed to locate given release packages directory - %spackages]" #l1 + ml-write "[Github Build: Generating packages zip]" + find-file &cat #l1 "packages/jmp.idx" + beginning-of-buffer + set-mark + end-of-buffer + -1 kill-region + insert-string &cat "JMP2\n20241201\n" #l9 + -1 buffer-mode "backup" + save-buffer + !force 0 delete-buffer $buffer-bname + !force 0 delete-buffer "*ghr1*" + find-buffer "*ghr1*" + set-variable $buffer-fname #l1 + shell-command "zip -r downloads/Jasspa_MicroEmacs_Latest_packages.zip packages" + !iif $result -8 ml-write &spr "[Github Release Error: Failed to create packages zip - zip returned %d]" $result + !iif ¬ &seq "R" &stat t &cat #l1 "Jasspa_MicroEmacs_Latest_packages.zip" -8 ml-write &spr "[Github Release Error: Failed to create packages zip - file not found]" + !force 0 delete-buffer "*ghr1*" + !endif github-api-json "releases" "" &spr "{\"tag_name\":\"%s%s\",\"target_commitish\":\"%s\",\"name\":\"%s%s\",\"generate_release_notes\":false,\"draft\":false,\"prerelease\":true}" .git.hub-rtp #l9 #l0 .git.hub-rnp #l9 !iif ¬ &xseq &set #l8 &rig ® &spr "/json/ghaj/id" "" 1 "\\h+" -8 ml-write &spr "[Github Release Error: Unexpected release ID - %s]" #l8 !iif ¬ &seq "\"http" &lef &set #l2 ® "/json/ghaj/upload_url" "" 5 -8 ml-write &spr "[Github Release Error: Unexpected upload_url %s]" #l2 @@ -371,6 +402,7 @@ define-macro github-finalise-release !force set-variable #l3 @3 !iif ¬ $status set-variable #l3 @ml61 "Release artifact directory" &spr "~/%s%s" .git.hub-rtp #l1 !iif ¬ &seq "D" &stat t &set #l3 &stat a #l3 -8 ml-write &spr "[Github Release Error: Given artifact directory is not a directory: %s]" #l3 + !iif ¬ &seq "R" &stat t &cat #l3 "commit_sha.txt" -8 ml-write &spr "[Github Release Error: Cannot locate release build commit sha: %scommit_sha.txt]" #l3 !iif ¬ &seq "R" &stat t &set #l4 &spr "%sJasspa_MicroEmacs_%s-sha256.txt" #l3 #l1 -8 ml-write &spr "[Github Release Error: Cannot locate main formula file: %s]" #l3 !force 0 delete-buffer "*ghdh" find-buffer "*ghdh" @@ -398,6 +430,12 @@ define-macro github-finalise-release github-api-json &cat "releases/" &rig #l9 1 "PATCH" "{\"prerelease\":false,\"make_latest\":true}" !iif ¬ &seq &set #l2 ® "/json/ghaj/id" "" #l9 -8 ml-write &spr "[Github Release Error: Unexpected release ID returned - %s]" #l2 !iif ¬ &seq &set #l2 ® "/json/ghaj/prerelease" "" "b0" -8 ml-write &spr "[Github Release Error: Unexpected prerelease setting %s]" #l2 + ; run the build-webpages action to update docs and packages + find-file &cat #l3 "commit_sha.txt" + beginning-of-buffer + set-variable #l0 @wl + !force 0 delete-buffer $buffer-bname + 0 github-build-action #l0 "build-webpages.yml" #l1 "" goto-position "\x80" ml-write "[Release Finalised - commit changes to jasspa & homebrew-jasspa repositories]" !emacro diff --git a/microemacs/doc/m4fil024.4 b/microemacs/doc/m4fil024.4 index 1069243d..aa2b4ea6 100755 --- a/microemacs/doc/m4fil024.4 +++ b/microemacs/doc/m4fil024.4 @@ -3,7 +3,7 @@ .\" Copyright (c) 1998-2009 JASSPA (www.jasspa.com) .\" See the file "me.nrs" for copying and conditions. .\" -.Id $Id: m4fil024.4,v 2.8 2024/11/11 15:58:44 jon Exp $ +.Id $Id: m4fil024.4,v 2.8 2024/12/22 21:42:54 jon Exp $ .Im MicroEmacs macro;function;miscellaneous .so me.tni .TH &find 4 @@ -34,10 +34,9 @@ initialized by the system of from the the environment variables .Ht $MEINSTALLPATH 5 etc. .PP -Each path component defined in \fB$search-path\fR is prepended to the -constructed file name and it's existence is tested. If the file exists, then -the \s-1FULL\s0 path name of the file is returned to the caller, otherwise -\fCERROR\fR. +Each path component defined in \fB$search-path\fR is prepended to the constructed file name and it's existence is +tested. If the file exists, then the \s-1FULL\s0 path name of the file is returned to the caller, otherwise the string +"\fCERROR\fR" is returned. .IP "\fI\fR" The base name of the file, excluding any extension. .IP "\fI\fR" @@ -48,8 +47,11 @@ The extension of the file name, this must be specified with the extension del for more information on \*(mS list format and functions. .PP .B &which -searches for the given executable program \fI\fR on the system -program search path defined the the environment variable \fB$PATH\fR. +searches for the given executable program \fI\fR on the system program search path defined by the +environment variable \fB$PATH\fR. If the program is found, then the \s-1FULL\s0 path to the program is returned, +otherwise the string "\fCERROR\fR" is returned. +.PP +Note that on dos and Windows only the extensions \fC.bat\fR, \fB.cmd\fR, \fC.com\fR and \fC.exe\fR are checked for. .SH USAGE .B &find is typically used with diff --git a/microemacs/macros/hkshell.emf b/microemacs/macros/hkshell.emf index fdaeb43d..11202a2c 100755 --- a/microemacs/macros/hkshell.emf +++ b/microemacs/macros/hkshell.emf @@ -64,7 +64,7 @@ set-variable .fhook-shell.item-list-r1 "Func \ecB\\1\ecA" ; Variables. hilight .hilight.shell 4 "\\$" "\\}\\W" "" .scheme.variable hilight .hilight.shell 0x80 "\\${" .hilight.shellV .scheme.variable - hilight .hilight.shell 4 "\\$(" ")\\s" "" .scheme.variable + hilight .hilight.shell 4 "\\$(" ")\\s" "" .scheme.variable hilight .hilight.shell 0 "\\$\\?" .scheme.variable hilight .hilight.shell 0 "\\$#" .scheme.variable hilight .hilight.shell 0 "\\$\\$" .scheme.variable diff --git a/microemacs/macros/mepinst.emf b/microemacs/macros/mepinst.emf index b45c73b5..e1d3e734 100644 --- a/microemacs/macros/mepinst.emf +++ b/microemacs/macros/mepinst.emf @@ -7,7 +7,6 @@ ; Synopsis: MicroEmacs package installer ; Authors: Steven Phillips ; -set-variable .help.purl "http://d1j8pqz26umfbo.cloudfront.net/packages/" set-variable .help.purl "http://docs.asid.family/packages/" 0 define-macro me-pinstall diff --git a/microemacs/src/evers.mak b/microemacs/src/evers.mak index fbbe6e90..9fb7f9bf 100644 --- a/microemacs/src/evers.mak +++ b/microemacs/src/evers.mak @@ -31,5 +31,5 @@ # meVER_CN = 20 meVER_YR = 24 -meVER_MN = 11 -meVER_DY = 2 +meVER_MN = 12 +meVER_DY = 1