diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5782c0d..d1964df 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,16 +20,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet-version }} - - # - name: Add Deveel GitHub NuGet Source - # run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text - + - name: Restore dependencies run: dotnet restore @@ -44,18 +41,19 @@ jobs: with: token: ${{ secrets.OCM_CODECOV_TOKEN }} - pack: + publish: needs: build name: "Pack" runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Pack - run: dotnet pack --configuration Release --no-restore --no-build --include-symbols --version-suffix $GITHUB_RUN_ID --output ./nuget + run: dotnet pack --configuration Release --include-symbols --version-suffix $GITHUB_RUN_ID --output ./nuget - name: Push Packages to GitHub NuGet run: dotnet nuget push ./nuget/**/*.nupkg --skip-duplicate --api-key ${{secrets.GITHUB_TOKEN}} --source "https://nuget.pkg.github.com/deveel/index.json" clean: - needs: pack + needs: publish name: "Clean Old Packages" uses: ./.github/workflows/clean-packages.yml \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 003b6a5..b266238 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,10 +26,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: ${{ matrix.dotnet-version }} - - # - name: Add Deveel GitHub NuGet Source - # run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text - + - name: Restore dependencies run: dotnet restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c86d875..f61db95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,9 @@ name: "Webhooks Release" +permissions: + contents: read + packages: write + on: release: types: [published] @@ -8,25 +12,24 @@ jobs: build: name: "Build and Test" runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + dotnet-verion: [ '6.0.x', '7.0.x', '8.0.x' ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set VERSION variable from tag run: | TAG=${{ github.event.release.tag_name }} echo "VERSION=${TAG#v}" >> $GITHUB_ENV - - name: Setup .NET - uses: actions/setup-dotnet@v3 + - name: Setup .NET ${{ matrix.dotnet-version }} + uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 6.0.x - 7.0.x - - - name: Add Deveel GitHub NuGet Source - run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text - + dotnet-version: ${{ matrix.dotnet-version }} + - name: Restore dependencies run: dotnet restore @@ -47,8 +50,10 @@ jobs: runs-on: ubuntu-latest name: "Pack" steps: + - uses: actions/checkout@v4 + - name: Pack - run: dotnet pack --configuration Release --no-restore --no-build --include-symbols -p:PackageVersion=$VERSION --output ./nuget + run: dotnet pack --configuration Release --include-symbols -p:PackageVersion=$VERSION --output ./nuget - name: Push Packages to GitHub NuGet run: dotnet nuget push ./nuget/**/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json