Skip to content

Commit

Permalink
Fixes to the CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutomi committed Feb 26, 2024
1 parent bedfedc commit 3fc41d7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
5 changes: 1 addition & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: "Webhooks Release"

permissions:
contents: read
packages: write

on:
release:
types: [published]
Expand All @@ -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

Expand All @@ -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

0 comments on commit 3fc41d7

Please sign in to comment.