Repository navigation
214 lines (189 loc) · 7.69 KB
/
Copy pathrelease.yml
File metadata and controls
214 lines (189 loc) · 7.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag_name:
description: 'Release Tag Name (e.g. v0.1.2)'
required: true
default: 'v0.1.2'
permissions:
contents: write
jobs:
build-release:
name: Build (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Linux
- goos: linux
goarch: amd64
artifact_name: bramand-linux-amd64
archive_format: tar.gz
- goos: linux
goarch: arm64
artifact_name: bramand-linux-arm64
archive_format: tar.gz
- goos: linux
goarch: arm
artifact_name: bramand-linux-armv7
archive_format: tar.gz
- goos: linux
goarch: '386'
artifact_name: bramand-linux-386
archive_format: tar.gz
# Android (Termux)
- goos: android
goarch: arm64
artifact_name: bramand-android-arm64
archive_format: tar.gz
- goos: linux
goarch: arm
artifact_name: bramand-android-armv7
archive_format: tar.gz
- goos: linux
goarch: amd64
artifact_name: bramand-android-amd64
archive_format: tar.gz
# macOS (Darwin)
- goos: darwin
goarch: amd64
artifact_name: bramand-darwin-amd64
archive_format: tar.gz
- goos: darwin
goarch: arm64
artifact_name: bramand-darwin-arm64
archive_format: tar.gz
# Windows
- goos: windows
goarch: amd64
artifact_name: bramand-windows-amd64
archive_format: zip
- goos: windows
goarch: arm64
artifact_name: bramand-windows-arm64
archive_format: zip
- goos: windows
goarch: '386'
artifact_name: bramand-windows-386
archive_format: zip
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.27.3'
cache: false
- name: Compile Native Binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
mkdir -p build_output
if [ "${{ matrix.goarch }}" = "arm" ]; then
export GOARM=7
fi
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME="bramand.exe"
go build -ldflags="-s -w" -o "build_output/${BINARY_NAME}" main.go
cp "build_output/${BINARY_NAME}" "build_output/bmd.exe"
else
BINARY_NAME="bramand"
go build -ldflags="-s -w" -o "build_output/${BINARY_NAME}" main.go
cp "build_output/${BINARY_NAME}" "build_output/bmd"
chmod +x "build_output/${BINARY_NAME}" "build_output/bmd"
fi
- name: Package Release Archive
id: package
run: |
mkdir -p dist
TAG="${{ github.ref_name }}"
if [ -z "$TAG" ] || [ "$TAG" = "main" ] || [ "$TAG" = "master" ]; then
TAG="${{ github.event.inputs.tag_name }}"
fi
if [ -z "$TAG" ]; then
TAG="v0.1.2"
fi
cp -r stdlib build_output/
cp README.md build_output/
if [ -f LICENSE ]; then cp LICENSE build_output/; fi
cd build_output
if [ "${{ matrix.archive_format }}" = "tar.gz" ]; then
ARCHIVE_NAME="${{ matrix.artifact_name }}-${TAG}.tar.gz"
tar -czvf "../dist/${ARCHIVE_NAME}" *
else
ARCHIVE_NAME="${{ matrix.artifact_name }}-${TAG}.zip"
zip -r "../dist/${ARCHIVE_NAME}" *
fi
cd ..
echo "archive_path=dist/${ARCHIVE_NAME}" >> $GITHUB_OUTPUT
echo "archive_name=${ARCHIVE_NAME}" >> $GITHUB_OUTPUT
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ steps.package.outputs.archive_path }}
publish-release:
name: Publish Release to GitHub
needs: build-release
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Download all built artifacts
uses: actions/download-artifact@v4
with:
path: release_assets
- name: Prepare Assets & Checksums
run: |
mkdir -p final_assets
find release_assets/ -type f \( -name "*.tar.gz" -o -name "*.zip" \) -exec cp {} final_assets/ \;
cd final_assets
sha256sum * > checksums.txt
cat checksums.txt
cd ..
- name: Publish Release via GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ github.ref_name }}"
if [ -z "$TAG" ] || [ "$TAG" = "main" ] || [ "$TAG" = "master" ]; then
TAG="${{ github.event.inputs.tag_name }}"
fi
if [ -z "$TAG" ]; then
TAG="v0.1.2"
fi
cat << 'EOF' > release_notes.md
✦ BramandScript Production Release ✦
High-performance, general-purpose programming language built from scratch with a Stack-based 64-bit Bytecode Virtual Machine, Pratt Parser, Centralized Package Manager, and modular standard library in pure Go. Zero external dependencies.
### Key Capabilities in this Release (v0.1.2):
- **Centralized Package & Module Architecture**: Full-featured package manager (`bmd install`, `bmd get`, `bmd cache info/prune/verify`, `bmd pkg init`), multi-tier entrypoint fallbacks, inter-process file locks, and offline determinism.
- **Supply-Chain Security & Permission Contracts**: Granular capability enforcement (`--allow-all`, `--allow-run`, `--allow-write`, `--allow-net`), checksum integrity verification, and package sandboxing.
- **Single-Binary Bundler**: Package and compile dependencies directly into self-contained standalone binaries (`bmd build -s`).
- **Enterprise Language Syntax**: Null-coalescing (`??`, `??=`), optional chaining (`?.`), ternary conditional (`? :`), string interpolation (`f"..."`, template literals), array/hash spread (`...`), default function parameters (`fn f(a, b = 10)`), LIFO `defer` statements.
- **Dynamic 64-Bit VM Engine**: 64-bit opcode operands, dynamic call frames (`--max-frames`), and configurable value stack.
- **Enterprise Standard Library**: `std/log`, `std/retry`, `std/config`, `std/uuid`, `std/semaphore`, `std/circuitbreaker`, `std/pool`, and advanced `std/collections` primitives.
- **Self-Contained Executable**: Standard library and packages fully embedded inside native binary via Go `embed.FS`.
### Available Binary Packages:
- **Linux**: x86_64, aarch64 (ARM64), ARMv7, x86 (32-bit)
- **Android Termux**: aarch64 (ARM64), ARMv7, x86_64
- **macOS**: Apple Silicon (arm64), Intel (x86_64)
- **Windows**: x86_64 (64-bit), ARM64, x86 (32-bit)
### Universal One-Liner Installer:
```bash
curl -fsSL https://raw.githubusercontent.com/Codeleafly/bramandScript/main/install.sh | bash
```
All archive checksums are verified in `checksums.txt`.
EOF
gh release create "$TAG" final_assets/* \
--title "BramandScript ${TAG}" \
--notes-file release_notes.md \
--draft=false \
--prerelease=false || \
gh release upload "$TAG" final_assets/* --clobber