https://github.com/netchris/workflows
Reusable GitHub workflows for NetChris
https://github.com/netchris/workflows
github-actions-workflows netchris-ci-managed
Last synced: 10 months ago
JSON representation
Reusable GitHub workflows for NetChris
- Host: GitHub
- URL: https://github.com/netchris/workflows
- Owner: NetChris
- Created: 2024-01-22T17:28:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-15T19:55:10.000Z (about 1 year ago)
- Last Synced: 2025-01-15T20:21:18.144Z (12 months ago)
- Topics: github-actions-workflows, netchris-ci-managed
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reusable GitHub workflows for NetChris
## `dotnet-build-test-pack-push-default.yml`
This is a simple build, test, pack and NuGet push for .NET projects. "Default" in that it assumes the `dotnet` SDK commands `build`, `test`, `pack` and `nuget push` can be run and all required information is defaulted (e.g. solutions, projects, tests). It also assumes that all NuGet packages that are packes with the `dotnet pack` SDK command will be pushed to the NuGet registry.
- If the `nuget_source` input isn't supplied, the organizational [GitHub NuGet registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry) (`https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json`) is assumed.
## `push-dotnet-build-test-pack-push-default.yml`
This workflow leverages `dotnet-build-test-pack-push-default.yml` and allows a simple configuration for push actions, ignoring pushed tags, with packages being pushed to the GitHub NuGet registry:
``` yaml
name: Push
on:
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
push:
permissions:
checks: write
contents: read
packages: write
uses: NetChris/workflows/.github/workflows/push-dotnet-build-test-pack-push-default.yml@SHA
```
Note the `permissions` requirement.
### .NET SDK version
To upgrade the .NET SDK version to use for `dotnet` commands, update the following bit in each file where `dotnet` is called:
``` yml
# ...
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
# ...
```
## `pre-release-nuget-org.yml`
This workflow leverages `dotnet-build-test-pack-push-default.yml` and allows a simple configuration for **pre-release** actions, with packages being pushed to NuGet.org:
``` yaml
# Put this in a "publish-nuget-org-pre-release.yml" file
name: Pre-Release - NuGet.org
on:
release:
types: [prereleased]
jobs:
push:
permissions:
contents: read
packages: write
uses: NetChris/workflows/.github/workflows/pre-release-nuget-org.yml@SHA
secrets: inherit
```
- Note the `permissions` requirement
- Note the `secrets: inherit` requirement
- Replace `SHA` with the appropriate SHA version of this repository
- A similar workflow exists, `pre-release-nuget-github.yml`, for the GitHub NuGet registry
## `release-nuget-org.yml`
This workflow leverages `dotnet-build-test-pack-push-default.yml` and allows a simple configuration for **release** actions, with packages being pushed to NuGet.org:
``` yaml
# Put this in a "publish-nuget-org-release.yml" file
name: Release - NuGet.org
on:
release:
types: [released]
jobs:
push:
permissions:
contents: read
packages: write
uses: NetChris/workflows/.github/workflows/release-nuget-org.yml@SHA
secrets: inherit
```
- Note the `permissions` requirement
- Note the `secrets: inherit` requirement
- Replace `SHA` with the appropriate SHA version of this repository
- A similar workflow exists, `release-nuget-github.yml`, for the GitHub NuGet registry