|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
release:
|
|
|
|
types: [ published ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
if: github.repository == 'ionite34/StabilityMatrix'
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: olegtarasov/get-tag@v2.1.2
|
|
|
|
id: tag_name
|
|
|
|
with:
|
|
|
|
tagRegex: "v(.*)"
|
|
|
|
|
|
|
|
- name: Set Tag
|
|
|
|
run: |
|
|
|
|
echo "Using tag ${{ env.GIT_TAG_NAME }}"
|
|
|
|
echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}.0" >> $env:GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Set up .NET
|
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
|
|
|
dotnet-version: '6.0.x'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: dotnet restore -p:PublishReadyToRun=true
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
env:
|
|
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
|
|
run: >
|
|
|
|
dotnet publish ./StabilityMatrix/StabilityMatrix.csproj
|
|
|
|
-o out -c Release -r win-x64
|
|
|
|
-p:Version=$env:RELEASE_VERSION -p:FileVersion=$env:RELEASE_VERSION -p:AssemblyVersion=$env:RELEASE_VERSION
|
|
|
|
-p:PublishReadyToRun=true -p:PublishSingleFile=true
|
|
|
|
-p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
|
|
|
|
-p:SentryUploadSymbols=true -p:SentryUploadSources=true
|
|
|
|
--self-contained true
|
|
|
|
|
|
|
|
- name: Remove old artifacts
|
|
|
|
uses: c-hive/gha-remove-artifacts@v1
|
|
|
|
with:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
age: '90 seconds'
|
|
|
|
skip-tags: false
|
|
|
|
|
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: StabilityMatrix
|
|
|
|
path: ./out/StabilityMatrix.exe
|
|
|
|
|
|
|
|
- name: Create Sentry release
|
|
|
|
if: ${{ env.MAKE_SENTRY_RELEASE == 'true' }}
|
|
|
|
uses: getsentry/action-release@v1
|
|
|
|
env:
|
|
|
|
MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }}
|
|
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
|
|
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
|
|
with:
|
|
|
|
environment: production
|
|
|
|
ignore_missing: true
|
|
|
|
version: StabilityMatrix@${{ env.GIT_TAG_NAME }}
|