Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
k-wojcik committed Mar 20, 2024
1 parent aadebd8 commit 085a8b1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 23 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,5 @@ jobs:
run: dotnet restore
- name: build
run: dotnet build --no-restore
release:
runs-on: ubuntu-latest
needs: build
#if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Setup .NET 8 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: pack
run: |
dotnet pack ./src/DocFxToTemplate/DocFxToTemplate.csproj --configuration Release -o ./dist/nupkg -p:Version=${VERSION}
dotnet pack ./src/DocFxToTemplate.Tool/DocFxToTemplate.Tool.csproj --configuration Release -o ./dist/nupkg -p:Version=${VERSION}
#- name: push
#run: dotnet nuget push ./dist/nupkg/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Archive NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./dist/nupkg
- name: test
run: dotnet test --no-restore
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: release

on:
release:
types: [published, edited]

jobs:
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Setup .NET 8 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore
- name: test
run: dotnet test --no-restore
- name: pack
run: |
dotnet pack ./src/DocFxToTemplate/DocFxToTemplate.csproj --configuration Release -o ./dist/nupkg -p:Version=${VERSION}
dotnet pack ./src/DocFxToTemplate.Tool/DocFxToTemplate.Tool.csproj --configuration Release -o ./dist/nupkg -p:Version=${VERSION}
- name: push
run: dotnet nuget push ./dist/nupkg/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: archive NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./dist/nupkg

0 comments on commit 085a8b1

Please sign in to comment.