Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 1 addition & 31 deletions .github/workflows/buildtestpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,34 +104,4 @@ jobs:
SAST:
uses: ./.github/workflows/sast.yml

Release:
runs-on: ubuntu-latest
needs: [ Build, SCA, Stryker, SAST ]
# if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
if: false

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Download package
uses: actions/download-artifact@v4
with:
name: benchmarkdotnet.analyser.nupkg
path: ${{ github.workspace }}/artifacts

- name: Push nuget package
run: dotnet nuget push "artifacts/*.nupkg" --api-key ${{ secrets.NUGET_TOKEN }} --source "nuget.org"

- name: Create Github Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.build-version-number }}
prerelease: false
generateReleaseNotes: true

44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Test and Package

permissions: # set permissions to principle of least privilege, codeql requires read permission to the repo content and PRs (if that option is set), and must have write permissions to security events in order to push results
actions: read
pull-requests: write
security-events: write
contents: write
checks: write

on:
workflow_dispatch:

env:
build-version-number: 0.4.${{ github.run_number }}

jobs:
Release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Restore tools
run: dotnet tool restore

- name: Build test and package
run: dotnet run --project build.fsproj -- -t "BuildTestAndPackage"

- name: Push nuget package
run: dotnet nuget push "publish/toolpackage/*.nupkg" --api-key ${{ secrets.NUGET_TOKEN }} --source "nuget.org"

- name: Create Github Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.build-version-number }}
prerelease: false
generateReleaseNotes: true