mirror of
https://github.com/daylinmorgan/tsm.git
synced 2024-12-22 05:00:44 -06:00
ci: ccnz is dead long live forge
This commit is contained in:
parent
0109817ce7
commit
6b2aa47269
4 changed files with 27 additions and 35 deletions
10
.forge.cfg
Normal file
10
.forge.cfg
Normal file
|
@ -0,0 +1,10 @@
|
|||
# example ccnz config file
|
||||
nimble
|
||||
|
||||
[target]
|
||||
x86_64-linux-gnu
|
||||
aarch64-linux-gnu
|
||||
x86_64-linux-musl
|
||||
x86_64-macos-none
|
||||
aarch64-macos-none
|
||||
|
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
@ -6,7 +6,6 @@ on:
|
|||
jobs:
|
||||
build-artifact:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
@ -16,10 +15,11 @@ jobs:
|
|||
|
||||
# for cross compilation with ccnz
|
||||
- uses: goto-bus-stop/setup-zig@v2
|
||||
- run: nimble install -Y https://github.com/daylinmorgan/ccnz
|
||||
|
||||
- name: Generate build artifacts
|
||||
run: nimble release
|
||||
run: |
|
||||
nimble install -Y forge
|
||||
nimble release
|
||||
|
||||
- name: Create artifact bundles
|
||||
run: nimble bundle
|
||||
|
|
8
.github/workflows/nightly.yml
vendored
8
.github/workflows/nightly.yml
vendored
|
@ -20,12 +20,12 @@ jobs:
|
|||
- name: print latest commit
|
||||
run: echo ${{ github.sha }}
|
||||
|
||||
- id: should_run
|
||||
name: check latest commit is less than a day
|
||||
- name: check latest commit is less than a day
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
run: |
|
||||
test -n "$(git rev-list --since="24 hours" HEAD)" \
|
||||
&& echo "quit=true" >> "$GITHUB_OUTPUT"
|
||||
if [[ -n "$(git rev-list --since='24 hours' HEAD)" ]]; then
|
||||
echo "quit=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
build-artifacts:
|
||||
needs: check-commits
|
||||
|
|
34
tsm.nimble
34
tsm.nimble
|
@ -15,37 +15,19 @@ requires "nim >= 2.0.0",
|
|||
"cligen"
|
||||
|
||||
import strformat
|
||||
const targets = [
|
||||
"x86_64-linux-gnu",
|
||||
"aarch64-linux-gnu",
|
||||
"x86_64-linux-musl",
|
||||
"x86_64-macos-none",
|
||||
"aarch64-macos-none",
|
||||
# "x86_64-windows-gnu" # no tsm on windows
|
||||
]
|
||||
|
||||
task release, "build release assets":
|
||||
mkdir "dist"
|
||||
for target in targets:
|
||||
let
|
||||
ext = if target == "x86_64-windows-gnu": ".cmd" else: ""
|
||||
outdir = &"dist/{target}/"
|
||||
app = projectName()
|
||||
exec &"ccnz cc --target {target} --nimble -- --out:{outdir}{app}{ext} -d:release src/{app}"
|
||||
version = (gorgeEx "git describe --tags --always --match 'v*'").output
|
||||
exec &"forge release -v {version} -V"
|
||||
|
||||
task bundle, "package build assets":
|
||||
cd "dist"
|
||||
for target in targets:
|
||||
let
|
||||
app = projectName()
|
||||
cmd =
|
||||
if target == "x86_64-windows-gnu":
|
||||
&"7z a {app}-v{version}-{target}.zip {target}"
|
||||
withDir "dist":
|
||||
for dir in listDirs("."):
|
||||
let cmd = if "windows" in dir:
|
||||
&"7z a {dir}.zip {dir}"
|
||||
else:
|
||||
&"tar czf {app}-v{version}-{target}.tar.gz {target}"
|
||||
|
||||
cpFile("../README.md", &"{target}/README.md")
|
||||
&"tar czf {dir}.tar.gz {dir}"
|
||||
cpFile("../README.md", &"{dir}/README.md")
|
||||
exec cmd
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue