mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-04-23 14:39:40 +00:00
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
name: NuGet Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'release'
|
|
tags:
|
|
- '[0-9]+.[0-9]+.[0-9]+'
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
- 'release'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0 # Fetch all history for versioning
|
|
|
|
- uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: 10.0.x
|
|
|
|
# Determine version using C# build target
|
|
- name: Determine Version
|
|
id: version
|
|
run: dotnet run --project build/build.csproj -- determine-version
|
|
|
|
# Update version in project file using C# build target
|
|
- name: Update Version in Project
|
|
run: dotnet run --project build/build.csproj -- update-version
|
|
env:
|
|
VERSION: ${{ steps.version.outputs.version }}
|
|
|
|
# Build and test
|
|
- name: Build and Test
|
|
run: dotnet run --project build/build.csproj
|
|
|
|
# Upload artifacts for verification
|
|
- name: Upload NuGet Package
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ${{ matrix.os }}-nuget-package
|
|
path: artifacts/*.nupkg
|
|
|
|
# Push to NuGet.org only for version tag pushes (Windows only)
|
|
- name: Push to NuGet
|
|
if: success() && matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/')
|
|
run: dotnet run --project build/build.csproj -- push-to-nuget
|
|
env:
|
|
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
|