Merge pull request #10 from NikRimington/dev/v1 #3
Workflow file for this run
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
name: Release Package | |
# This action will start when a correctly formatted tag is pushed (e.g. 0.1.0) | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+*" | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup .NET v6 | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Setup .NET v8 | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build project | |
run: dotnet build src\AccessibleMediaPicker\HCS.Media.AccessibleMediaPicker.csproj --configuration Release | |
pack: | |
runs-on: windows-latest | |
needs: build | |
if: github.event_name == 'push' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup .NET v6 | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Setup .NET v8 | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 8.0.x | |
- name: Determine version | |
run: echo "::set-env name=VERSION::$(git describe --tags --dirty)" | |
- name: Pack | |
run: dotnet pack --output ./artifacts --configuration Release -p:Version=$VERSION | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: ./artifacts | |
publish: | |
runs-on: ubuntu-latest | |
needs: pack | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Setup .NET v8 | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 8.0.x | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
path: ./artifacts | |
- name: Push to NuGet | |
run: dotnet nuget push ./artifacts/**.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json |