Package up artifacts for release

This commit is contained in:
Caelan
2024-10-02 16:48:16 -06:00
parent 8e9ef358df
commit d64cbbbe66
3 changed files with 41 additions and 11 deletions

View File

@@ -30,6 +30,11 @@ jobs:
key: "rust-test-${{ matrix.os }}"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Check lib-nodejs
working-directory: src/lib-nodejs
run: |
npm install
npm run build
- name: Check lib-rust
run: cargo check -p velopack -F async,delta
- name: Check RustIced Sample
@@ -39,9 +44,7 @@ jobs:
run: cargo llvm-cov ${{ matrix.rust_flags }} --cobertura --output-path ./test/coverage.rust.${{ matrix.os }}.xml
- name: Test lib-nodejs
working-directory: src/lib-nodejs
run: |
npm install
npm run test
run: npm run test
- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
@@ -138,8 +141,6 @@ jobs:
build-rust-macos:
runs-on: macos-latest
env:
RUSTFLAGS: -C target-feature=+crt-static
steps:
- uses: actions/checkout@v4
with:
@@ -260,7 +261,7 @@ jobs:
env:
VELOPACK_CROSS_ARTIFACTS: true
run: dotnet test test/Velopack.Packaging.Tests/Velopack.Packaging.Tests.csproj --no-build -c Release --filter "FullyQualifiedName~RunCrossApp" -l "console;verbosity=detailed;consoleLoggerParameters=ErrorsOnly" -l GithubActions -- RunConfiguration.CollectSourceInformation=true
package:
runs-on: ubuntu-latest
needs: [build-rust-windows, build-rust-linux, build-rust-macos]
@@ -299,10 +300,38 @@ jobs:
with:
name: packages
path: build/Release/*nupkg
organise-artifacts:
runs-on: ubuntu-latest
needs: [package, test-dotnet]
steps:
- name: Download
uses: actions/download-artifact@v4
with:
path: bin-core
pattern: rust-*
merge-multiple: true
- name: Rearrange
run: |
mkdir bin-nodejs
mv bin-core/*.node bin-nodejs/
- name: Upload Core
uses: actions/upload-artifact@v4
with:
name: bin-core
path: bin-core/*
- name: Upload Node
uses: actions/upload-artifact@v4
with:
name: bin-nodejs
path: bin-nodejs/*
- uses: geekyeggo/delete-artifact@v5
with:
name: rust-*
release:
runs-on: ubuntu-latest
needs: [package, test-dotnet, test-rust]
needs: [package, test-dotnet, test-rust, organise-artifacts]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Invoke Release Workflow

View File

@@ -104,4 +104,4 @@ jobs:
run: |
for f in packages/*.nupkg; do
dotnet nuget push "$f" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
done
done

View File

@@ -1,6 +1,9 @@
param(
[string]$version = $(nbgv get-version -v NuGetPackageVersion).Trim()
)
$scriptDir = $PSScriptRoot
$path = Join-Path $scriptDir "Cargo.toml"
$version = (nbgv get-version -v NuGetPackageVersion).Trim()
Write-Host "Setting version to $version"
(Get-Content $path) | ForEach-Object {
@@ -12,7 +15,5 @@ Write-Host "Setting version to $version"
}
} | Set-Content $path
cargo pkgid -p velopack
Set-Location "$scriptDir/src/lib-nodejs"
npm version $version --no-git-tag-version