Skip to content

Commit

Permalink
Merge pull request #4 from Memkits/updates
Browse files Browse the repository at this point in the history
doing workflow updates
  • Loading branch information
csvwolf authored Oct 29, 2024
2 parents 8b9a680 + 22c9e8e commit cd0dba7
Show file tree
Hide file tree
Showing 7 changed files with 2,875 additions and 2,055 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,21 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: ACTIONS_ALLOW_UNSECURE_COMMANDS
id: ACTIONS_ALLOW_UNSECURE_COMMANDS
run: echo 'ACTIONS_ALLOW_UNSECURE_COMMANDS=true' >> $GITHUB_ENV

- name: add cr
run: |
mkdir -p $GITHUB_WORKSPACE/bin
wget -O $GITHUB_WORKSPACE/bin/cr https://github.com/calcit-lang/calcit/releases/download/0.6.1/cr
chmod +x $GITHUB_WORKSPACE/bin/cr
echo "::add-path::$GITHUB_WORKSPACE/bin"
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: "prepare modules"
run: >
mkdir -p ~/.config/calcit/modules/ && cd ~/.config/calcit/modules/
&& git clone https://github.com/calcit-lang/lilac.git
&& git clone https://github.com/calcit-lang/memof.git
&& git clone https://github.com/Respo/respo.calcit.git
&& git clone https://github.com/Respo/reel.calcit.git
&& git clone https://github.com/Respo/respo-markdown.calcit.git
&& git clone https://github.com/Respo/respo-ui.calcit.git
- uses: calcit-lang/[email protected]
with:
bundler: false

- name: "compiles to js"
run: >
cr --emit-js -1
&& (cd js-out/ && ln -s ../assets/bitwise.js .)
caps --ci && cr --once js
&& cp assets/bitwise.js js-out/
&& yarn && yarn vite build --base=./
- name: Deploy to server
Expand All @@ -50,6 +38,3 @@ jobs:
ssh_options: ''
src: 'dist/*'
dest: '[email protected]:/web-assets/repo/${{ github.repository }}'

- name: Display status from deploy
run: echo "${{ steps.deploy.outputs.status }}"
3,695 changes: 2,151 additions & 1,544 deletions calcit.cirru

Large diffs are not rendered by default.

613 changes: 358 additions & 255 deletions compact.cirru

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

{}
:calcit-version |0.9.5
:dependencies $ {}
|calcit-lang/lilac |main
|calcit-lang/memof |main
|Respo/respo.calcit |main
|Respo/reel.calcit |main
|Respo/alerts.calcit |main
|Respo/respo-markdown.calcit |main
|Respo/respo-ui.calcit |main
32 changes: 32 additions & 0 deletions lib/hex.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

export function binary_to_hex(binary) {
// validation input
if (!/^[01]+$/.test(binary) || binary.length % 4 !== 0) {
throw new Error("Invalid binary string");
}

let hex = "";
for (let i = 0; i < binary.length; i += 4) {
const chunk = binary.slice(i, i + 4);
const decimal = Number.parseInt(chunk, 2);
hex += decimal.toString(16);
}

return hex.toLowerCase();
}

export function hex_to_binary(hex) {
// validation input
if (!/^[0-9A-Fa-f]+$/.test(hex)) {
throw new Error("Invalid hexadecimal string");
}

let binary = "";
for (let i = 0; i < hex.length; i++) {
const decimal = Number.parseInt(hex[i], 16);
const chunk = decimal.toString(2).padStart(4, "0");
binary += chunk;
}

return binary;
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"@calcit/procs": "^0.6.1",
"copy-text-to-clipboard": "^3.0.1"
"@calcit/procs": "^0.9.5",
"copy-text-to-clipboard": "^3.2.0"
},
"devDependencies": {
"vite": "^3.0.3"
"vite": "^5.4.10"
},
"version": "0.0.1"
}
Loading

0 comments on commit cd0dba7

Please sign in to comment.