Skip to content

Commit

Permalink
Revert workflow deletions (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArieGato authored Nov 24, 2024
1 parent edac4ea commit 384268d
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/label.yml
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
64 changes: 64 additions & 0 deletions .github/workflows/publish-release.yml
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}`)
});
}
2 changes: 2 additions & 0 deletions Serilog.Sinks.RabbitMQ.sln
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{D9046050-14F3-4815-979E-80BC1D4657A2}"
ProjectSection(SolutionItems) = preProject
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
.github\workflows\label.yml = .github\workflows\label.yml
.github\workflows\publish-prerelease.yml = .github\workflows\publish-prerelease.yml
.github\workflows\publish-release.yml = .github\workflows\publish-release.yml
.github\workflows\tests.yml = .github\workflows\tests.yml
EndProjectSection
EndProject
Expand Down

0 comments on commit 384268d

Please sign in to comment.