Release DisCatSharp #176
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 DisCatSharp" | |
on: | |
workflow_dispatch: | |
inputs: | |
version_suffix: | |
description: "Version Suffix" | |
required: false | |
type: string | |
release_as_prerelease: | |
description: "Release as pre-release" | |
required: true | |
type: boolean | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
jobs: | |
release: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
name: Build library and release | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: | | |
8.0.100 | |
7.0.404 | |
- name: Restore dependencies | |
run: dotnet restore --no-cache -f -v minimal DisCatSharp.sln | |
- name: Build library as full release | |
if: ${{!inputs.release_as_prerelease}} | |
shell: pwsh | |
run: ./DisCatSharp.Tools/rebuild-lib.ps1 -ArtifactLocation ./dcs-artifacts -Configuration Release | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
- name: Build library as pre-release | |
if: ${{inputs.release_as_prerelease}} | |
shell: pwsh | |
run: ./DisCatSharp.Tools/rebuild-lib.ps1 -ArtifactLocation ./dcs-artifacts -Configuration Release -VersionSuffix ${{github.event.inputs.version_suffix}} | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
- name: Remove invalid packages | |
shell: pwsh | |
run: rm *.symbols.* | |
working-directory: ./dcs-artifacts | |
- name: Publish to NuGet | |
shell: pwsh | |
run: dotnet nuget push --source https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} * --skip-duplicate | |
working-directory: ./dcs-artifacts | |
- name: Publish to GitHub Packages | |
shell: pwsh | |
run: dotnet nuget push --source https://nuget.pkg.github.com/Aiko-IT-Systems/index.json -k ${{secrets.NYUW_TOKEN_GH}} * | |
working-directory: ./dcs-artifacts | |
- name: Set outputs | |
id: vars | |
run: | | |
echo "version=10.5.0" >> $GITHUB_OUTPUT | |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: "Create Sentry prod release" | |
if: ${{!inputs.release_as_prerelease}} | |
uses: getsentry/[email protected] | |
with: | |
environment: prod | |
ignore_missing: true | |
version: DisCatSharp@${{ steps.vars.outputs.version }}+${{ steps.vars.outputs.sha }} | |
- name: "Create Sentry dev release" | |
if: ${{inputs.release_as_prerelease}} | |
uses: getsentry/[email protected] | |
with: | |
environment: dev | |
ignore_missing: true | |
version: DisCatSharp@${{ steps.vars.outputs.version }}-${{ github.event.inputs.version_suffix }}+${{ steps.vars.outputs.sha }} |