Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Feb 26, 2024
1 parent 39eda91 commit 5b7a139
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: caesay # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
125 changes: 125 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Build

on: [ push, pull_request ]

jobs:
build-fusion:
runs-on: windows-latest
steps:
- name: Print dotnet version
run: dotnet --info

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Library Versions
run: dotnet run --set-version

- name: Build Fusion
run: dotnet run

build-cli:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Print dotnet version
run: dotnet --info

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Library Versions
run: dotnet run --set-version

- name: Set Rust Flags (Windows)
shell: pwsh
run: |
rustup target add i686-pc-windows-msvc
Add-Content -Path $env:GITHUB_ENV -Value "EXTRA_RUST_FLAGS=--target i686-pc-windows-msvc --features windows"
if: ${{ matrix.os == 'windows-latest' }}

- name: Set Rust Flags (Linux)
run: echo "EXTRA_RUST_FLAGS=--target x86_64-unknown-linux-gnu" >> "$GITHUB_ENV"
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Build Rust
working-directory: for-rust
run: cargo build --release ${{ env.EXTRA_RUST_FLAGS }}

- name: Collect Rust Binaries (Windows)
working-directory: for-rust/target
run: |
copy i686-pc-windows-msvc\release\*.exe release
copy i686-pc-windows-msvc\release\*.pdb release
if: ${{ matrix.os == 'windows-latest' }}

- name: Collect Rust Binaries (Linux)
working-directory: for-rust/target
run: cp ./x86_64-unknown-linux-gnu/release/vfusion ./release/VfusionNix
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Collect Rust Binaries (OSX)
working-directory: for-rust/target/release
run: cp vfusion VfusionMac
if: ${{ matrix.os == 'macos-latest' }}

- name: Upload Rust Artifacts
uses: actions/upload-artifact@v4
with:
name: vfusion-cli-${{ matrix.os }}
path: |
for-rust/target/release/VfusionMac
for-rust/target/release/VfusionNix
for-rust/target/release/*.exe
# package:
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - name: Print dotnet version
# run: dotnet --info

# - uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - uses: actions/cache@v4
# with:
# path: ~/.nuget/packages
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
# restore-keys: ${{ runner.os }}-nuget-

# - name: Download Rust OSX
# uses: actions/download-artifact@v4
# with:
# name: rust-macos-latest
# path: for-rust/target/release

# - name: Download Rust Windows
# uses: actions/download-artifact@v4
# with:
# name: rust-windows-latest
# path: for-rust/target/release

# - name: Download Rust Linux
# uses: actions/download-artifact@v4
# with:
# name: rust-ubuntu-latest
# path: for-rust/target/release

# - name: Build .NET
# run: dotnet build -c Release /p:PackRustAssets=true

# - name: Upload Package Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: packages
# path: build/Release/*.nupkg

# - name: Publish to GitHub Packages
# shell: pwsh
# run: dotnet nuget push build/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ These libraries are a light weight wrapper around `vfusion.exe`. They will provi
### Command Line
While there might not be a client library for your programming language, you can always redistribute the `vfusion.exe` binary with your application and use the command line interface to download updates. The command line reference is below:

```sh
```txt
$ vfusion.exe -h
Velopack Fusion (0.0.0-local) manages and downloads packages.
https://github.com/velopack/velopack
Expand Down Expand Up @@ -82,7 +82,7 @@ The rest of the libraries available here are transpiled from [fusion / fut](http

## Compiling Fusion
There is a custom build system written in C#. To compile all of Fusion you can run the following commands in your terminal:
```sh
```txt
git clone https://github.com/velopack/velopack.fusion.git
cd velopack.fusion
dotnet run
Expand Down
1 change: 1 addition & 0 deletions build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
if (parseResult.GetValueForOption(setVersionArg))
{
var newVersion = GetNbgvVersion();
Log("Setting library versions to: " + newVersion);
ReplaceAll(Path.Combine(projectDir, "for-js/package.json"), @"""version"":\s?""([\d\w\.-]+)"",", $@"""version"": ""{newVersion}"",", true);
ReplaceAll(Path.Combine(projectDir, "for-rust/Cargo.toml"), @"^version\s?=\s?""([\d\w\.-]+)""$", $@"version = ""{newVersion}""", true);
return;
Expand Down

0 comments on commit 5b7a139

Please sign in to comment.