Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update library workflows #49

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/publish-razor-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Razor library deployment

on:
push:
branches:
- main
- dev

jobs:
build:
env:
BUILD_CONFIG: Release
BUILD_PATH: "./src/razor/Proton.Common.Razor.csproj"
NUGET_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
source-url: ${{ env.NUGET_URL }}

- name: Restore Workloads
run: dotnet workload restore ${{ env.BUILD_PATH }}

- name: Restore
run: dotnet restore ${{ env.BUILD_PATH }}

- name: Build
run: dotnet build --no-restore ${{ env.BUILD_PATH }} -c ${{ env.BUILD_CONFIG }}

- name: Test
run: dotnet test ${{ env.BUILD_PATH }} -c ${{ env.BUILD_CONFIG }} --no-build

- name: Pack
run: dotnet pack --no-build ${{ env.BUILD_PATH }} -c ${{ env.BUILD_CONFIG }} -o ./artifacts

- name: Update nuget source
run: dotnet nuget update source -s ${{ env.NUGET_URL }} -u ${{ github.repository_owner }} -p ${{ env.NUGET_AUTH_TOKEN }} --store-password-in-clear-text github

- name: Publish nuget package
run: dotnet nuget push artifacts/*.nupkg -s ${{ env.NUGET_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} --skip-duplicate
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- path: "./src/http/Proton.Common.Http.csproj"
- path: "./src/efcore/Proton.Common.EFCore.csproj"
- path: "./src/aspnet/Proton.Common.AspNet.csproj"
- path: "./src/razor/Proton.Common.Razor.csproj"

steps:
- uses: actions/checkout@v3
Expand Down