Skip to content

Release CI

Release CI #37

Workflow file for this run

name: Release CI
on:
release:
types: [published]
env:
VERBOSITY: 'Minimal'
CONFIGURATION: 'Release'
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
Build:
name: Release Build on .NET Core ${{ matrix.dotnet }}
runs-on: [ubuntu-latest]
strategy:
matrix:
dotnet: ['8.0.402']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract build and copyright information into variables
id: info
run: |
echo "BUILD=${{ github.run_number }}" >> $GITHUB_ENV
echo "COPYRIGHT=$(echo © $(date -u +%Y) Bytewizer. All rights reserved.)" >> $GITHUB_ENV
- name: Show build information
run: |
echo BUILD=${{ env.BUILD }}
echo COPYRIGHT=${{ env.COPYRIGHT }}
- name: Show release event information
run: |
echo "release.name = ${{ github.event.release.name }}"
echo "release.body = ${{ github.event.release.body }}"
echo "release.upload_url = ${{ github.event.release.upload_url }}"
echo "release.html_url = ${{ github.event.release.html_url }}"
echo "release.tag_name = ${{ github.event.release.tag_name }}"
echo "release.draft = ${{ github.event.release.draft }}"
echo "release.prerelease = ${{ github.event.release.prerelease }}"
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Show .NET Core information
run: dotnet --info
- name: Build and test project
run: >-
dotnet test -p:Version=${GITHUB_REF##*/v} -p:BuildNumber="${{ env.BUILD }}" -p:Copyright="${{ env.COPYRIGHT }}"
--verbosity ${VERBOSITY}
--configuration ${CONFIGURATION}
env:
Agent__ApplicationKey: ${{ secrets.AGENT_APPLICATION_KEY }}
Agent__KeyId: ${{ secrets.AGENT_KEY_ID }}
- name: Build and release project
run: >-
dotnet pack -p:PackageVersion=${GITHUB_REF##*/v} -p:BuildNumber="${{ env.BUILD }}" -p:Copyright="${{ env.COPYRIGHT }}"
--verbosity ${{ env.VERBOSITY }}
--configuration ${{ env.CONFIGURATION }}
--include-symbols
--output ./builds/artifacts
- name: Publish package to github.com
run: |
dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -n github
dotnet nuget push ./builds/artifacts/**/*.nupkg -s github -k ${{secrets.PACKAGE_API_KEY}} --skip-duplicate
- name: Publish package to nuget
run: |
dotnet nuget push ./builds/artifacts/**/*.nupkg -s nuget.org -k ${{secrets.NUGET_API_KEY}} --skip-duplicate