Skip to content

Commit

Permalink
Merge pull request #30 from ieedan/remove-mac-stuff
Browse files Browse the repository at this point in the history
Maybe someone smarter than me can make this work
  • Loading branch information
ieedan authored May 24, 2024
2 parents 7a0198e + df17cbc commit 3f5a5dd
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 64 deletions.
81 changes: 24 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,50 @@
name: Build and Release
name: build

on:
push:
tags: ["v*.*.*"]

jobs:
build-and-publish:
build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Install Dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64
sudo apt-get -y install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
rustup target add x86_64-pc-windows-gnu
rustup target add i686-pc-windows-gnu
rustup target add x86_64-unknown-linux-gnu
mkdir dist
mkdir builds
- name: Build Linux
run: |
rustup target add x86_64-unknown-linux-gnu
cargo rustc --release --target=x86_64-unknown-linux-gnu
mkdir -p builds/vnv-linux
cp target/x86_64-unknown-linux-gnu/release/vnv builds/vnv-linux
tar -C builds -czvf dist/vnv-linux.tar.gz vnv-linux
- name: Install osxcross dependencies
- name: Build Win64
run: |
sudo apt-get install -y clang llvm make libc6-dev-i386 libc6-dev-x32 libssl-dev libbz2-dev curl zlib1g-dev libxml2-dev libxslt1-dev libreadline-dev
cargo rustc --release --target=x86_64-pc-windows-gnu --bin vnv -- -C linker=x86_64-w64-mingw32-gcc
mkdir builds/vnv-win64
cp target/x86_64-pc-windows-gnu/release/vnv.exe builds/vnv-win64
tar -C builds -czvf dist/vnv-win64.tar.gz vnv-win64
- name: Set up osxcross
- name: Build Win32
run: |
git clone https://github.com/tpoechtrager/osxcross.git
cd osxcross
./tools/get_dependencies.sh
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.11.sdk.tar.xz
tar -xf MacOSX10.11.sdk.tar.xz -C tarballs
UNATTENDED=yes ./build.sh
env:
PATH: /home/runner/work/osxcross/target/bin:$PATH

- name: Build macOS
env:
CC: x86_64-apple-darwin14-clang
CXX: x86_64-apple-darwin14-clang++
run: |
rustup target add x86_64-apple-darwin
cargo rustc --release --target=x86_64-apple-darwin
mkdir -p builds/vnv-macos
cp target/x86_64-apple-darwin/release/vnv builds/vnv-macos
mkdir -p dist
tar -C builds -czvf dist/vnv-macos.tar.gz vnv-macos
- name: Build Windows 64-bit
run: |
rustup target add x86_64-pc-windows-gnu
cargo rustc --release --target=x86_64-pc-windows-gnu
mkdir -p builds/vnv-windows-64
cp target/x86_64-pc-windows-gnu/release/vnv.exe builds/vnv-windows-64
tar -C builds -czvf dist/vnv-windows-64.tar.gz vnv-windows-64
cargo rustc --release --target=i686-pc-windows-gnu --bin vnv -- -C linker=i686-w64-mingw32-gcc -C link-args=-mwindows -C panic=abort
mkdir builds/vnv-win32
cp target/i686-pc-windows-gnu/release/vnv.exe builds/vnv-win32
tar -C builds -czvf dist/vnv-win32.tar.gz vnv-win32
- name: Build Windows 32-bit
- name: Build Linux
run: |
rustup target add i686-pc-windows-gnu
cargo rustc --release --target=i686-pc-windows-gnu
mkdir -p builds/vnv-windows-32
cp target/i686-pc-windows-gnu/release/vnv.exe builds/vnv-windows-32
tar -C builds -czvf dist/vnv-windows-32.tar.gz vnv-windows-32
cargo rustc --release --target=x86_64-unknown-linux-gnu
mkdir builds/vnv-linux
cp target/x86_64-unknown-linux-gnu/release/vnv builds/vnv-linux
tar -C builds -czvf dist/vnv-linux.tar.gz vnv-linux
- name: Upload release
uses: softprops/action-gh-release@v1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vnv"
version = "0.1.2"
version = "0.1.1"
authors = ["Aidan Bleser"]
edition = "2021"
readme = "README.md"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
A decorator enhanced **.env** syntax for validating your environment variables.

```bash
# linux / windows
npm install @iedan/vnv
```

or

```bash
# linux / windows/ mac
cargo install vnv
```

Expand Down
9 changes: 5 additions & 4 deletions npm/getBinary.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ function getPlatform() {
return "linux";
}

if (type === "Darwin" && arch === "x64") {
return "macos";
}
// Having issues getting this to compile so just skipping for now
// if (type === "Darwin" && arch === "x64") {
// return "macos";
// }

throw new Error(
`Unsupported platform: ${type} ${arch}. Please create an issue at https://github.com/ieedan/vnv#issues`
Expand All @@ -33,4 +34,4 @@ function getBinary() {
return new Binary(url, { name: "vnv" });
}

module.exports = getBinary;
module.exports = getBinary;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iedan/vnv",
"version": "0.1.2",
"version": "0.1.1",
"description": "A decorator enhanced env syntax.",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 3f5a5dd

Please sign in to comment.