Skip to content

Commit 76086d9

Browse files
committed
fix: website publish
1 parent a32aea0 commit 76086d9

File tree

23 files changed

+11330
-8912
lines changed

23 files changed

+11330
-8912
lines changed

.github/lua.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -euo pipefail
44

5-
LUA_VERSION="5.4.6"
5+
LUA_VERSION="5.4.7"
66
# https://www.lua.org/ftp/#
77
pushd /tmp
88
curl -L -R -O http://www.lua.org/ftp/lua-$LUA_VERSION.tar.gz

.github/odin.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
set -euo pipefail
44

5-
VERSION=dev-2024-01
6-
FILE_NAME=odin-ubuntu-amd64-$VERSION.zip
5+
VERSION=dev-2024-11
6+
FILE_NAME=odin-linux-amd64-$VERSION.zip
77
sudo apt-get install -y aria2
8-
mkdir /tmp/odin
8+
mkdir /tmp/odin || true
99
cd /tmp/odin
1010
aria2c -c -o $FILE_NAME https://github.com/odin-lang/Odin/releases/download/$VERSION/$FILE_NAME
11-
if test -d ubuntu_artifacts; then sudo rm -rf ubuntu_artifacts; fi
1211
unzip -o $FILE_NAME
13-
if test -d ubuntu_artifacts; then ODIN_BIN_PATH=$PWD/ubuntu_artifacts/odin; else ODIN_BIN_PATH=$PWD/odin; fi
14-
sudo chmod +x $ODIN_BIN_PATH
12+
tar -xvf dist.tar.gz
13+
ODIN_BIN_PATH=$(pwd)/$(find */odin)
1514
sudo ln -sf $ODIN_BIN_PATH /usr/bin/odin
1615
odin version

.github/workflows/bench.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,17 @@ jobs:
342342
- name: Install
343343
run: |
344344
ls -al bench/build/_results/
345+
- run: corepack enable && corepack prepare pnpm@9 --activate
346+
- run: pnpm --version
345347
- name: Site Update Content
346348
run: |
347349
pushd website
348350
pnpm i
349351
pnpm content
352+
pnpm build
353+
pnpm archive-dist
350354
- name: Site Publish
351355
if: github.ref == 'refs/heads/main'
352356
env:
353357
VERCEL_PUBLISH_TOKEN: ${{ secrets.VERCEL_PUBLISH_TOKEN }}
354-
run: vercel website --prod --confirm -t $VERCEL_PUBLISH_TOKEN || echo 'ignore errors'
358+
run: vercel website --prod --yes -t $VERCEL_PUBLISH_TOKEN || echo 'ignore errors'

.github/workflows/site.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ jobs:
2323
- uses: pnpm/action-setup@v2
2424
with:
2525
version: 8
26+
- run: corepack enable && corepack prepare pnpm@9 --activate
2627
- run: pnpm --version
2728
- run: vercel --version
2829
- name: Build
2930
run: |
3031
cd website
3132
pnpm i
3233
pnpm build
34+
pnpm archive-dist

bench/algorithm/binarytrees/1.odin

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,63 @@
33
package main
44

55
import "core:fmt"
6-
import "core:strconv"
7-
import "core:os"
86
import "core:math"
97
import "core:mem"
8+
import "core:os"
9+
import "core:strconv"
1010

1111
MIN_DEPTH :: 4
1212
main :: proc() {
13-
n := strconv.parse_int(os.args[1]) or_else 10
14-
max_depth := math.max(MIN_DEPTH+2,n)
15-
{
16-
stretch_depth := max_depth + 1
17-
stretch_tree := makeTree(stretch_depth)
18-
defer { delete_tree(stretch_tree) }
19-
fmt.printf("stretch tree of depth %d\t check: %d\n", stretch_depth, check(stretch_tree) );
20-
}
21-
long_lived_tree := makeTree(max_depth)
22-
defer delete_tree(long_lived_tree)
23-
depth:int= MIN_DEPTH;
24-
for ;depth <= max_depth; depth += 2 {
25-
iterations := 1 << u8(max_depth - depth + MIN_DEPTH)
26-
sum: u64 = 0
27-
for _ in 0..<iterations {
28-
tree := makeTree(depth)
29-
defer { delete_tree(tree) }
30-
sum += u64(check(tree))
31-
}
32-
fmt.printf("%d\t trees of depth %d\t check: %d\n", iterations, depth, sum )
33-
}
13+
#no_bounds_check n := strconv.parse_int(os.args[1]) or_else 10
14+
max_depth := math.max(MIN_DEPTH + 2, n)
15+
{
16+
stretch_depth := max_depth + 1
17+
stretch_tree := makeTree(stretch_depth)
18+
defer {delete_tree(stretch_tree)}
19+
fmt.printf("stretch tree of depth %d\t check: %d\n", stretch_depth, check(stretch_tree))
20+
}
21+
long_lived_tree := makeTree(max_depth)
22+
defer delete_tree(long_lived_tree)
23+
depth: int = MIN_DEPTH
24+
for ; depth <= max_depth; depth += 2 {
25+
iterations := 1 << u8(max_depth - depth + MIN_DEPTH)
26+
sum: u64 = 0
27+
for _ in 0 ..< iterations {
28+
tree := makeTree(depth)
29+
defer {delete_tree(tree)}
30+
sum += u64(check(tree))
31+
}
32+
fmt.printf("%d\t trees of depth %d\t check: %d\n", iterations, depth, sum)
33+
}
3434

35-
fmt.printf("long lived tree of depth %d\t check: %d\n", max_depth, check(long_lived_tree))
35+
fmt.printf("long lived tree of depth %d\t check: %d\n", max_depth, check(long_lived_tree))
3636
}
3737

3838
Node :: struct {
39-
left,right:^Node,
39+
left, right: ^Node,
4040
}
4141

42-
makeTree::proc(depth:int)->^Node {
43-
node := new(Node)
44-
if node == nil {
45-
fmt.println("alloc error")
46-
return node
47-
}
48-
if depth > 0 {
49-
node.left = makeTree(depth-1)
50-
node.right = makeTree(depth-1)
51-
}
52-
return node
42+
makeTree :: proc(depth: int) -> ^Node {
43+
node := new(Node)
44+
if node == nil {
45+
fmt.println("alloc error")
46+
return node
47+
}
48+
if depth > 0 {
49+
node.left = makeTree(depth - 1)
50+
node.right = makeTree(depth - 1)
51+
}
52+
return node
5353
}
54-
delete_tree::proc(t:^Node){
55-
if t.left != nil {delete_tree(t.left)}
56-
if t.right != nil {delete_tree(t.right)}
57-
free(t)
54+
delete_tree :: proc(t: ^Node) {
55+
if t.left != nil {delete_tree(t.left)}
56+
if t.right != nil {delete_tree(t.right)}
57+
free(t)
5858
}
59-
check::proc(tree:^Node)->int {
60-
sum : int = 1
61-
if tree == nil { return 0 }
62-
sum += check(tree.left)
63-
sum += check(tree.right)
64-
return sum
59+
check :: proc(tree: ^Node) -> int {
60+
sum: int = 1
61+
if tree == nil {return 0}
62+
sum += check(tree.left)
63+
sum += check(tree.right)
64+
return sum
6565
}

bench/algorithm/helloworld/1.odin

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package main
22

3+
import "base:runtime"
34
import "core:fmt"
4-
import "core:runtime"
55

66
main :: proc() {
7-
args := runtime.args__
8-
name := len(args) > 1 ? args[1] : ""
7+
args := runtime.args__
8+
name := len(args) > 1 ? args[1] : ""
99
fmt.printf("Hello world %s!\n", name)
1010
}

0 commit comments

Comments
 (0)