From d64cbbbe6694fb40a524a539e586bdc211e8f1e2 Mon Sep 17 00:00:00 2001 From: Caelan Date: Wed, 2 Oct 2024 16:48:16 -0600 Subject: [PATCH] Package up artifacts for release --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++++------ .github/workflows/release.yml | 2 +- set-nbgv-version.ps1 | 7 +++--- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d68385e..a18d3cbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cb16660..c56a359f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 \ No newline at end of file + done diff --git a/set-nbgv-version.ps1 b/set-nbgv-version.ps1 index c223a7bb..1a3a54a3 100644 --- a/set-nbgv-version.ps1 +++ b/set-nbgv-version.ps1 @@ -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 \ No newline at end of file