Skip to content

Commit

Permalink
sill still working publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
rheone committed Jan 7, 2025
1 parent 8eb8659 commit ed46e3c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@ name: Build and Test

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dotnet tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore ./src
- name: Build
run: dotnet build ./src --no-restore
- name: Test
run: dotnet test ./src --no-build --verbosity normal
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dotnet tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore ./src
- name: Build
run: dotnet build ./src --no-restore
- name: Test
run: dotnet test ./src --no-build --verbosity normal
46 changes: 23 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ name: Publish .NET Package
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-*'
- "v*.*.*"
- "v*.*.*-*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dotnet tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore ./src
- name: Build
run: dotnet build ./src --no-restore
- name: Extract version
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Pack
run: dotnet pack ./src/NetDuid.sln --configuration Release --no-build --output ./packages /p:PackageVersion=${{ env.VERSION }}
- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push ./packages/*.nupkg --source "https://github.com/sandialabs/index.json" --api-key $GITHUB_TOKEN
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dotnet tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore ./src
- name: Build
run: dotnet build ./src --no-restore
- name: Extract version
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Pack
run: dotnet pack ./src/NetDuid/NetDuid.csproj --configuration Release --no-build --output ./packages /p:PackageVersion=${{ env.VERSION }}
- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push ./packages/*.nupkg --source "https://nuget.pkg.github.com/sandialabs/netduid/index.json" --api-key $GITHUB_TOKEN

0 comments on commit ed46e3c

Please sign in to comment.