Skip to content

Bump Microsoft.NET.Test.Sdk from 17.0.0 to 17.9.0 in /tests/.dependabot #123

Bump Microsoft.NET.Test.Sdk from 17.0.0 to 17.9.0 in /tests/.dependabot

Bump Microsoft.NET.Test.Sdk from 17.0.0 to 17.9.0 in /tests/.dependabot #123

Workflow file for this run

# CI/CD pipeline.
name: CICD
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
pull_request:
push:
branches:
- "main"
env:
CI: true
jobs:
version:
name: Create a version number
runs-on: ubuntu-20.04
timeout-minutes: 1
outputs:
tag: ${{ steps.create_version.outputs.tag }}
package: ${{ steps.create_version.outputs.package }}
permissions:
contents: 'write'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Create version
id: create_version
uses: degory/create-version@v0.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
PRERELEASE: ${{ github.event_name == 'pull_request' }}
build:
name: Build and publish NuGet package
runs-on: ubuntu-latest
container: ghcr.io/degory/ghul/devcontainer:dotnet
timeout-minutes: 10
needs: [version]
steps:
- uses: actions/checkout@v3
- name: Restore local .NET tools
run: dotnet tool restore
- name: Run tests
run: dotnet test tests/tests.ghulproj
- name: Create package
run: dotnet pack -p:Version=${{ needs.version.outputs.package }}
- name: Upload package artefact
uses: actions/upload-artifact@v4
with:
name: package
path: nupkg
- name: Publish package to GitHub
if: ${{ github.actor != 'dependabot[bot]' }}
run: dotnet nuget push ./nupkg/*.nupkg -k ${GITHUB_TOKEN} -s https://nuget.pkg.github.com/degory/index.json --skip-duplicate --no-symbols
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package to NuGet
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: dotnet nuget push ./nupkg/*.nupkg -k ${NUGET_TOKEN} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
create_release:
needs: [version, build]
name: Create release
runs-on: ubuntu-20.04
timeout-minutes: 5
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- name: Download package
uses: actions/download-artifact@v4
with:
name: package
path: nupkg
- name: Create changelog
run: git log -1 --format="%s%n%n%b%n%n" >changelog.txt
- name: Create a Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.version.outputs.tag }}
release_name: ${{ needs.version.outputs.tag }}
body_path: changelog.txt
draft: false
- name: Upload package asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nupkg/ghul.runtime.${{ needs.version.outputs.package }}.nupkg
asset_name: ghul.runtime.${{ needs.version.outputs.package }}.nupkg
asset_content_type: application/octet-stream