Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Mar 24, 2024
1 parent 4f0feff commit cca5513
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 45 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
name: Build and release

on:
workflow_dispatch:
push:
branches:
- "master"

permissions:
contents: write


jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update release tag
uses: EndBug/latest-tag@latest

static:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Install Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build
run: |
mkdir release
nix build .#pkgsCross.musl64.hover-rs -L
cp -vL ./result/bin/hover release/hover-static-x86_64-linux
- uses: ncipollo/release-action@v1
name: Release
with:
tag: latest
makeLatest: true
omitBody: true
omitName: true
allowUpdates: true
replacesArtifacts: true
artifacts: "release/*"

40 changes: 4 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ caps = "0.5.5"
clap = { version = "4.5.2", features = ["derive"] }
color-eyre = "0.6.2"
eyre = "0.6.12"
format-bytes = "0.3.0"
nix = { version = "0.28.0", features = ["fs", "feature", "sched", "user", "mount"] }
owo-colors = "4.0.0"
rand = "0.8.5"
Expand Down
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
{ self, nixpkgs }:
{
packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.callPackage ./package.nix { };

legacyPackages.x86_64-linux = import nixpkgs {
system = "x86_64-linux";
overlays = [ (final: prev: { hover-rs = final.callPackage ./package.nix { }; }) ];
};
};
}
6 changes: 0 additions & 6 deletions manifest.scm

This file was deleted.

9 changes: 8 additions & 1 deletion package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{ rustPlatform, lib }:
{
rustPlatform,
lib,
targetPlatform,
}:
rustPlatform.buildRustPackage {
name = "hover-rs";

Expand All @@ -15,6 +19,9 @@ rustPlatform.buildRustPackage {

strictDeps = true;
cargoLock.lockFile = ./Cargo.lock;

env.RUSTFLAGS = lib.optionalString (targetPlatform.libc == "musl") "-C target-feature=+crt-static";

meta = {
mainProgram = "hover";
};
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::utils::NNONE;

use caps::{CapSet, Capability};
use eyre::{bail, ensure, Context};
use format_bytes::format_bytes;
use nix::libc::SIGCHLD;
use nix::mount::{mount, MsFlags};
use nix::sched::{clone, unshare, CloneFlags};
Expand Down

0 comments on commit cca5513

Please sign in to comment.