Skip to content

Build and upload binary #14

Build and upload binary

Build and upload binary #14

Workflow file for this run

# This workflow will automatically upload a binary artifact when a release/tag is created
name: Build and upload binary
on:
# allow to build manually
workflow_dispatch:
# build automatically when pushing a tag
push:
branches:
- "!*"
tags:
- "v*"
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
steps:
- uses: actions/checkout@v2
- name: Build binary
run: |
STABLE_NIM=`curl -sSL http://nim-lang.org/channels/stable | xargs`
curl -O https://nim-lang.org/download/nim-$STABLE_NIM-linux_x64.tar.xz
tar -xvJf nim-$STABLE_NIM-linux_x64.tar.xz
NIMPATH=`pwd`/nim-$STABLE_NIM-linux_x64/bin
PATH=$PATH:$NIMPATH
# compile choosenim
cd $CHOOSENIM_DIR
nimble install -y
nimble build --path:$NIMPATH
ls bin/*
- name: Upload binaries to release/tag
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
tag: ${{ github.ref }}
asset_name: choosenim-manylinux2014
file: ${{ runner.workspace }}/choosenim/bin/choosenim
# ----------------------------------------------------------------------------
# this uses choosenim by itself - you may need to build manually if you break choosenim
build-win32:
runs-on: windows-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
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
tag: ${{ github.ref }}
asset_name: choosenim-windows
file: ${{ runner.workspace }}/choosenim/bin/choosenim.exe
# ----------------------------------------------------------------------------
# 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: |
git config --global --add safe.directory /__w/choosenim/choosenim
nimble install -y
nimble build
ls bin/*
- name: Upload binaries to release/tag
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
tag: ${{ github.ref }}
asset_name: choosenim-macos
file: ${{ runner.workspace }}/choosenim/bin/choosenim