-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This workflow will triage pull requests and apply a label based on the | ||
# paths that are modified in the pull request. | ||
# | ||
# To use this workflow, you will need to set up a .github/labeler.yml | ||
# file with configuration. For more information, see: | ||
# https://github.com/actions/labeler/blob/master/README.md | ||
|
||
name: Labeler | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened # when PR is opened | ||
|
||
jobs: | ||
label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@v5 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
continue-on-error: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Publish release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build solution [Release] | ||
run: dotnet build --no-restore -c Release | ||
|
||
- name: Pack solution [Release] | ||
run: dotnet pack --no-build -c Release -o dist/packages | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nuget-packages | ||
path: dist/packages | ||
|
||
- name: Publish Nuget to nuget.org registry | ||
run: dotnet nuget push ./dist/packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | ||
|
||
- name: Upload Nuget packages as release artifacts | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
console.log('environment', process.versions); | ||
const fs = require('fs').promises; | ||
const { repo: { owner, repo }, sha } = context; | ||
for (let file of await fs.readdir('./dist/packages')) { | ||
console.log('uploading', file); | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner, | ||
repo, | ||
release_id: ${{ github.event.release.id }}, | ||
name: file, | ||
data: await fs.readFile(`./dist/packages/${file}`) | ||
}); | ||
} |
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