Skip to content

Daily build

Daily build #59

Workflow file for this run

name: Tests
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
pull_request:
branches:
- main
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
6.0.x
3.1.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release -p:Nullable=disable -p:nowarn=1591
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Set version tag
run: |
Version='5.0.0-daily'
echo "VERSION=$Version" >> $GITHUB_ENV
echo "Version: $Version"
- name: Build and pack daily build from Main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
dotnet restore
dotnet build --no-restore --configuration Release Ical.Net/Ical.Net.csproj -p:Version=${{env.VERSION}} -p:FileVersion=${{env.VERSION}}.${{github.run_number}} -p:Nullable=disable -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true
dotnet pack --configuration Release Ical.Net/Ical.Net.csproj -p:Version=${{env.VERSION}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg --no-build -p:PackageVersion=${{env.VERSION}}.${{github.run_number}}
- name: Store artifacts
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: ICal.Net_pkg_${{env.VERSION}}.${{github.run_number}}
path: |
Ical.Net/bin/Release/**/*.nupkg
Ical.Net/bin/Release/**/*.snupkg
- name: Push package to GitHub Packages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: dotnet nuget push Ical.Net/bin/Release/Ical.Net.${{env.VERSION}}.${{github.run_number}}.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate