Skip to content

Commit

Permalink
Included params on 'yml
Browse files Browse the repository at this point in the history
  • Loading branch information
evertondavid committed Jul 22, 2024
1 parent 393dfa2 commit 457ee82
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/continous-integration-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,34 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
PROJECT_PATH: HATEOAS # Definindo o caminho do projeto como uma variável de ambiente

steps:
- name: Checkout
uses: actions/checkout@v3

- name: List directories and files
run: |
ls -laH
cd HATEOAS
ls -laH
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: List directories and files
run: ls -la

- name: Restore dependencies
run: |
cd HATEOAS
cd ${{ env.PROJECT_PATH }}
dotnet restore HATEOAS.csproj
- name: Build
run: |
cd HATEOAS
cd ${{ env.PROJECT_PATH }}
dotnet build --no-restore HATEOAS.csproj
- name: Change .csproj version
run: |
cd HATEOAS
# Increment version in your project file (e.g., .csproj)
cd ${{ env.PROJECT_PATH }}
PROJECT_FILE=HATEOAS.csproj
CURRENT_VERSION=$(grep -oP '<Version>\K[^<]+' $PROJECT_FILE)
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{$NF+=1; OFS="."; print $0}')
Expand All @@ -49,15 +47,15 @@ jobs:
- name: Generate Release
run: |
cd HATEOAS
cd ${{ env.PROJECT_PATH }}
dotnet build -c release HATEOAS.csproj
- name: Generate Nuget Package
run: |
cd HATEOAS
cd ${{ env.PROJECT_PATH }}
dotnet pack -c release -o ./dist/ HATEOAS.csproj
- name: Push Nuget Package
run: |
cd HATEOAS
dotnet nuget push "./dist/*" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
cd ${{ env.PROJECT_PATH }}
dotnet nuget push "./dist/*" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

0 comments on commit 457ee82

Please sign in to comment.