Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds binary build GitHub Action for x86_64-unknown-linux-gnu target #460

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/build-nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env nix-shell
#!nix-shell ../nix/mixed.nix -i bash

echo ✨ System Details
uname -a

echo ✨ PWD=$PWD

echo ✨ CC=$CC
echo ✨ CXX=$CXX

echo ✨ rustup target add $1
rustup target add $1

echo 👷 Cargo Build
cargo build --release --locked --target $1
64 changes: 64 additions & 0 deletions .github/workflows/publish-x86_64-unknown-linux-gnu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: build-x86_64-unknown-linux-gnu
# <arch>-<vendor>-<os>-<env>

on:
workflow_dispatch:
push:
tags:
- "v*"

jobs:
build-x86_64-unknown-linux-gnu:
runs-on: ubuntu-22.04
strategy:
max-parallel: 1
matrix:
target: [x86_64-unknown-linux-gnu]

steps:
- name: Checkout
uses: actions/checkout@v1

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-22.05

- uses: cachix/cachix-action@v11
with:
name: nargo-cache
# If you chose signing key for write access
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
# If you chose API tokens for write access OR if you have a private cache
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build environment and Compile
run: |
chmod +x .github/build-nix
.github/build-nix ${{ matrix.target }}

- name: Package artifacts
run: |
mkdir dist
cp ./target/${{ matrix.target }}/release/nargo ./dist/nargo
mkdir -p ./dist/noir-lang/std
cp crates/std_lib/src/*.nr ./dist/noir-lang/std
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-${{ matrix.target }}.gz

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./nargo-${{ matrix.target }}.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions nix/mixed.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
nativeBuildInputs = with pkgs; [
which
git
pkg-config
cmake
];

buildInputs = with pkgs; [
llvmPackages.openmp
openssl
rustup
];

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.llvmPackages.openmp
pkgs.openssl
];

shellHook = ''
echo 🧪 NIX_CFLAGS_COMPILE=$NIX_CFLAGS_COMPILE
echo 🧪 NIX_LDFLAGS=$NIX_LDFLAGS
echo 🧪 LD_LIBRARY_PATH=$LD_LIBRARY_PATH
echo 🧪 CPATH=$CPATH
echo 🧪 $CC $AR $CXX $LD
echo 🧪 $(which $CC)
echo 🧪 $(which $AR)
echo 🧪 $(which $CXX)
echo 🧪 $(which $LD)
echo 🧪 $(which pkg-config)
echo 🧪 pkg-config --list-all ↩️
pkg-config --list-all
echo ⌛
'';

}