-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/atlas-tool
- Loading branch information
Showing
17 changed files
with
235 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,132 @@ | ||
# This workflow will automatically upload a binary artifact when a release/tag is created | ||
name: Build and upload binary | ||
|
||
on: | ||
# allow to build manually | ||
on: | ||
# allow to build manually | ||
workflow_dispatch: | ||
# build automatically when pushing a tag | ||
# build automatically when pushing a tag | ||
push: | ||
branches: | ||
- "!*" | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
ZIG_SYSTEM_LINKER_HACK: 1 | ||
|
||
jobs: | ||
# ---------------------------------------------------------------------------- | ||
# this will checkout and build nim stable from gh repository on manylinux2014 / CentOS 7 | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/pypa/manylinux2014_x86_64 | ||
build: | ||
timeout-minutes: 45 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Windows builds | ||
- os: windows-latest | ||
target: x86_64-windows-gnu | ||
suffix: windows_amd64 | ||
cpu: amd64 | ||
- os: windows-latest | ||
target: aarch64-windows-gnu | ||
suffix: windows_arm64 | ||
cpu: arm64 | ||
# Linux builds | ||
- os: ubuntu-latest | ||
target: aarch64-linux-gnu | ||
suffix: linux_arm64 | ||
cpu: arm64 | ||
- os: ubuntu-latest | ||
target: x86_64-linux-gnu | ||
suffix: linux_amd64 | ||
cpu: amd64 | ||
# MacOS builds | ||
- os: macos-latest | ||
target: aarch64-macos-none | ||
suffix: macosx_arm64 | ||
cpu: arm64 | ||
- os: macos-latest | ||
target: x86_64-macos-none | ||
suffix: macosx_amd64 | ||
cpu: amd64 | ||
runs-on: ${{ matrix.os }} | ||
name: Build ${{ matrix.target }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Setup Nim | ||
uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install zig | ||
uses: korandoru/setup-zig@v1 | ||
with: | ||
zig-version: 0.11.0 | ||
- name: Install dependencies | ||
run: | | ||
nimble install -y zigcc | ||
- name: Build proxy | ||
run: | | ||
nimble -y c src/choosenimpkg/proxyexe -d:zig.target="${{ matrix.target }}" --cpu:"${{ matrix.cpu }}" -d:release --opt:size | ||
- name: Build binary | ||
run: | | ||
CHOOSENIM_DIR=`pwd` | ||
# checking out and compiling nim last stable from git tag | ||
mkdir -p nimDir | ||
STABLE_NIM=`curl -sSL http://nim-lang.org/channels/stable | xargs` | ||
git clone --depth 1 --branch v$STABLE_NIM https://github.com/nim-lang/Nim.git nimDir | ||
cd nimDir | ||
sh build_all.sh | ||
bin/nim c koch | ||
./koch boot -d:release | ||
./koch tools | ||
PATH=$PATH:`pwd`/bin | ||
# compile choosenim | ||
cd $CHOOSENIM_DIR | ||
nimble install -y | ||
nimble build | ||
ls bin/* | ||
nimble -y build -d:noBuildProxy -d:zig.target="${{ matrix.target }}" --cpu:"${{ matrix.cpu }}" -d:release --opt:size | ||
- name: Update file name | ||
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} | ||
run: mv bin/choosenim bin/choosenim-${{ github.ref_name }}_${{ matrix.suffix }} | ||
- name: Update file name | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: mv bin\choosenim.exe bin\choosenim-${{ github.ref_name }}_${{ matrix.suffix }}.exe | ||
|
||
- name: Upload binaries to release/tag | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
overwrite: true | ||
overwrite: true | ||
file_glob: true | ||
tag: ${{ github.ref }} | ||
asset_name: choosenim-manylinux2014 | ||
file: ${{ runner.workspace }}/choosenim/bin/choosenim | ||
file: bin/choosenim-${{ github.ref_name }}_${{ matrix.suffix }}* | ||
- name: Upload artefacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: choosenim-${{ github.ref_name }}_${{ matrix.suffix }} | ||
path: bin/choosenim-${{ github.ref_name }}_${{ matrix.suffix }}* | ||
retention-days: 1 | ||
|
||
# ---------------------------------------------------------------------------- | ||
# this uses choosenim by itself - you may need to build manually if you break choosenim | ||
build-win32: | ||
runs-on: windows-latest | ||
deploy-site: | ||
name: Deploy site | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: iffy/[email protected] | ||
- name: Build binary | ||
run: | | ||
nimble install -y | ||
nimble build | ||
dir bin/* | ||
- name: Upload binaries to release/tag | ||
uses: svenstaro/upload-release-action@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download workflow artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
overwrite: true | ||
tag: ${{ github.ref }} | ||
asset_name: choosenim-windows | ||
file: ${{ runner.workspace }}/choosenim/bin/choosenim.exe | ||
path: site/ | ||
|
||
# ---------------------------------------------------------------------------- | ||
# this uses choosenim by itself - you may need to build manually if you break choosenim | ||
build-macos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: iffy/[email protected] | ||
- name: Build binary | ||
run: | | ||
nimble install -y | ||
nimble build | ||
ls bin/* | ||
- name: Upload binaries to release/tag | ||
uses: svenstaro/upload-release-action@v2 | ||
- name: Add latest version | ||
run: echo "${{ github.ref_name }}" >> site/stable | ||
|
||
- name: Setup Nim | ||
uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
overwrite: true | ||
tag: ${{ github.ref }} | ||
asset_name: choosenim-macos | ||
file: ${{ runner.workspace }}/choosenim/bin/choosenim | ||
nim-version: devel | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create index | ||
run: nim md2html --out:site/index.html readme.md | ||
|
||
- name: Add init script | ||
run: mv scripts/choosenim-unix-init.sh site/init.sh | ||
|
||
- name: Create pages artefact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: site/ | ||
|
||
- name: Deploy site | ||
uses: actions/deploy-pages@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
nim-tests: | ||
name: Nim tests | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Nim | ||
uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Can build | ||
run: nimble -y build | ||
|
||
- name: Run tests | ||
run: nimble -y test | ||
|
||
unix-test: | ||
name: Install script test (Unix like) | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run script | ||
run: bash scripts/choosenim-unix-init.sh -y | ||
|
||
- name: Update path | ||
run: echo "~/.nimble/bin" >> $GITHUB_PATH | ||
|
||
- name: Test Nim works | ||
run: nim --version |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const target {.strdefine: "zig.target".} = "" | ||
if target != "": | ||
switch("cc", "clang") | ||
let zigCmd = "zigcc" & (if defined(windows): ".cmd" else: "") | ||
switch("clang.exe", zigCmd) | ||
switch("clang.linkerexe", zigCmd) | ||
let targetArgs = "-target " & target | ||
switch("passL", targetArgs) | ||
switch("passC", targetArgs) | ||
|
||
when defined(macosx): | ||
# We need to define extra search paths | ||
# Found via the default paths here | ||
# https://discussions.apple.com/thread/2390561?sortBy=best#11330927022 | ||
switch("passL", "-F/Library/Frameworks -F/System/Library/Frameworks -F/System/Library/Frameworks/Security.framework -L/usr/lib -L/usr/local/lib") | ||
switch("passL", "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk") | ||
|
||
switch("d", "zippyNoSimd") |
Oops, something went wrong.