-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build/test and package/publish actions
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build and test | ||
|
||
env: | ||
DOTNET_VERSION: '9.0.x' | ||
PROJECT_NAME: src/Monobank.Core/Monobank.Core.csproj | ||
TEST_PROJECT_NAME: src/Monobank.Tests/Monobank.Tests.csproj | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore ${{ env.PROJECT_NAME }} | ||
|
||
- name: Build the project | ||
run: dotnet build ${{ env.PROJECT_NAME }} --configuration Release --no-restore | ||
|
||
- name: Test the project | ||
run: dotnet test ${{ env.TEST_PROJECT_NAME }} --no-build --verbosity normal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Package and publish | ||
|
||
env: | ||
DOTNET_VERSION: '9.0.x' | ||
PROJECT_NAME: src/Monobank.Core/Monobank.Core.csproj | ||
TEST_PROJECT_NAME: src/Monobank.Tests/Monobank.Tests.csproj | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore ${{ env.PROJECT_NAME }} | ||
|
||
- name: Build the project | ||
run: dotnet build ${{ env.PROJECT_NAME }} --configuration Release --no-restore | ||
|
||
- name: Test the project | ||
run: dotnet test ${{ env.TEST_PROJECT_NAME }} --no-build --verbosity normal | ||
|
||
- name: Pack the project | ||
run: dotnet pack ${{ env.PROJECT_NAME }} --configuration Release --no-restore --output ./publish | ||
|
||
- name: Push to the packages | ||
run: dotnet nuget push ./publish/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters