Missing the checkout command in publish pipeline #138
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
name: Repository CI/CD | |
permissions: | |
contents: read | |
packages: write | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet: [ '6.0.x', '7.0.x', '8.0.x' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Emit .NET 6.0 Framework Version | |
if: matrix.dotnet == '6.0.x' | |
run: echo "DOTNET_FX_VERSION=net6.0" >> $GITHUB_ENV | |
- name: Emit .NET 7.0 Framework Version | |
if: matrix.dotnet == '7.0.x' | |
run: echo "DOTNET_FX_VERSION=net7.0" >> $GITHUB_ENV | |
- name: Emit .NET 8.0 Framework Version | |
if: matrix.dotnet == '8.0.x' | |
run: echo "DOTNET_FX_VERSION=net8.0" >> $GITHUB_ENV | |
- name: Setup .NET ${{ matrix.dotnet }} Framework | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- name: Install SQLite Spatial | |
run: sudo apt-get install -y libsqlite3-mod-spatialite | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c Release -f ${{ env.DOTNET_FX_VERSION }} | |
- name: Test | |
run: dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_FX_VERSION }} | |
build: | |
name: "Build and Push Artifacts" | |
needs: validate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup GitFlow | |
uses: gittools/actions/gitversion/setup@v1.1.1 | |
with: | |
versionSpec: '5.x' | |
- name: Determine Version | |
uses: gittools/actions/gitversion/execute@v1.1.1 | |
- name: Setup .NET 8.0 Framework | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build | |
run: dotnet build -c Release /p:Version="${{ env.GitVersion_SemVer }}" /p:AssemblyVersion="${{ env.GitVersion_AssemblySemVer }}" /p:FileVersion="${{ env.GitVersion_AssemblySemFileVer }}" | |
- name: Pack the Nuget Packages | |
run: dotnet pack -c Release --no-build --no-restore --include-symbols --include-source --output nupkgs /p:PackageVersion="${{ env.GitVersion_NuGetVersionV2 }}" | |
- name: Publish the Nuget Packages to the GitHub Package Registry | |
run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/deveel/index.json" | |
clean: | |
name: "Clean Old Packages" | |
needs: build | |
uses: ./.github/workflows/clean-packages.yml |