diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5792b8b..28b1b67 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,36 @@ -name: ⚙️ Build Binaries +name: 👑 ⚙️ Build Nim Binaries w/ Forge and Atlas on: - workflow_dispatch: workflow_call: jobs: build-artifact: - uses: daylinmorgan/actions/.github/workflows/build-nim-forge.yml@main + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: jiro4989/setup-nim-action@v1 + with: + nim-version: 2.0.0 + + - uses: goto-bus-stop/setup-zig@v2 + + - name: Setup Build Environment + run: | + nimble install -Y 'https://github.com/nim-lang/atlas.git@#f7ade65f' forge + atlas init --deps:.workspace + atlas install + + - name: Create artifact bundles + run: nim release && nim bundle + + - uses: actions/upload-artifact@v3 + with: + name: artifacts + path: | + dist/*.tar.gz + dist/*.zip + diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9b8d5a9..53df73e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,7 +17,7 @@ jobs: build-artifacts: needs: check-commits if: ${{ needs.check-commits.outputs.quit != 'true' }} - uses: daylinmorgan/actions/.github/workflows/build-nim-forge.yml@main + uses: ./.github/workflows/build.yml generate-release: needs: build-artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4834b4..f4db1df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ permissions: jobs: build-artifacts: - uses: daylinmorgan/actions/.github/workflows/build-nim-forge.yml@main + uses: ./.github/workflows/build.yml create-release: needs: build-artifacts diff --git a/config.nims b/config.nims index 59eb228..abf7073 100644 --- a/config.nims +++ b/config.nims @@ -1,2 +1,25 @@ +import std/[strformat, strutils] + + task debugTui, "debug tui": exec "nim -d:debug c -r src/tui.nim" + +task build, "build app": + selfExec "c -o:bin/tsm src/tsm.nim" + +task release, "build release assets": + version = (gorgeEx "git describe --tags --always --match 'v*'").output + exec &"forge release -v {version} -V" + +task bundle, "package build assets": + withDir "dist": + for dir in listDirs("."): + echo dir + let cmd = if "windows" in dir: + &"7z a {dir}.zip {dir}" + else: + &"tar czf {dir}.tar.gz {dir}" + cpFile("../README.md", &"{dir}/README.md") + exec cmd + + diff --git a/tsm.nimble b/tsm.nimble index 5fca2e2..3290492 100644 --- a/tsm.nimble +++ b/tsm.nimble @@ -15,20 +15,3 @@ requires "nim >= 2.0.0", "cligen", "https://github.com/daylinmorgan/bbansi#main" -import strformat - -task release, "build release assets": - version = (gorgeEx "git describe --tags --always --match 'v*'").output - exec &"forge release -v {version} -V" - -task bundle, "package build assets": - withDir "dist": - for dir in listDirs("."): - let cmd = if "windows" in dir: - &"7z a {dir}.zip {dir}" - else: - &"tar czf {dir}.tar.gz {dir}" - cpFile("../README.md", &"{dir}/README.md") - exec cmd - -