Skip to content

housekeeping: Release 2.1 #335

housekeeping: Release 2.1

housekeeping: Release 2.1 #335

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]
env:
configuration: Release
productNamespacePrefix: "Citrus.Avalonia"
jobs:
build:
runs-on: ubuntu-latest
outputs:
nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'recursive'
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.100
- name: NBGV
id: nbgv
uses: dotnet/nbgv@master
with:
setAllVars: true
- name: Build
run: dotnet build --configuration ${{ env.configuration }}
working-directory: src
- name: Create NuGet Artifacts
uses: actions/upload-artifact@v4
with:
name: nuget
path: '**/*.nupkg'
release:
runs-on: ubuntu-latest
needs: build
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download NuGet Packages
uses: actions/download-artifact@v4
with:
name: nuget
- name: Changelog
uses: glennawatson/ChangeLog@v1
id: changelog
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ needs.build.outputs.nbgv }}
release_name: ${{ needs.build.outputs.nbgv }}
body: |
${{ steps.changelog.outputs.commitLog }}
- name: NuGet Push
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg