Skip to content

Pass libcurl to the linker #82

Pass libcurl to the linker

Pass libcurl to the linker #82

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*"
env:
ZIG_SYSTEM_LINKER_HACK: 1
jobs:
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
args:
- os: windows-latest
target: aarch64-windows-gnu
suffix: windows_arm64
cpu: arm64
args:
# Linux builds
- os: ubuntu-latest
target: aarch64-linux-musl
suffix: linux_arm64
cpu: arm64
args:
- os: ubuntu-latest
target: x86_64-linux-musl
suffix: linux_amd64
cpu: amd64
args:
# MacOS builds
- os: macos-latest
target: aarch64-macos-none
suffix: macosx_arm64
cpu: arm64
args:
- os: macos-latest
target: x86_64-macos-none
suffix: macosx_amd64
cpu: amd64
args:
# Android (Termux)
- os: ubuntu-latest
target: aarch64-linux-musl
suffix: android_arm64
cpu: arm64
args: -d:android
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.target }}
steps:
- 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:ci ${{ matrix.args }}
- name: Build binary
run: |
nimble -y build -d:zig.target="${{ matrix.target }}" --cpu:"${{ matrix.cpu }}" -d:ci -d:noBuildProxy ${{ matrix.args }}
- 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
if: ${{ github.ref_name != 'vtest' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
file_glob: true
tag: ${{ github.ref }}
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
deploy-site:
if: ${{ github.ref_name != 'vtest' }}
name: Deploy site
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download workflow artifact
uses: actions/download-artifact@v4
with:
path: site/
- name: Add latest version
run: echo "${{ github.ref_name }}" >> site/stable
- name: Setup Nim
uses: jiro4989/setup-nim-action@v1
with:
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