Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

161 lines
4.9 KiB

name: Release
on:
workflow_dispatch:
inputs:
version:
type: string
description: Version (Semver without leading v)
sentry-release:
type: boolean
description: Make Sentry Release?
default: false
release:
types: [ published ]
jobs:
release-linux:
if: github.repository == 'ionite34/StabilityMatrix' || github.event_name == 'workflow_dispatch'
name: Release (linux-x64)
env:
platform-id: linux-x64
out-name: StabilityMatrix.AppImage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: olegtarasov/get-tag@v2.1.2
if: github.event_name == 'release'
id: tag_name
with:
tagRegex: "v(.*)"
- name: Set Version from Tag
if: github.event_name == 'release'
run: |
echo "Using tag ${{ env.GIT_TAG_NAME }}"
echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}" >> $GITHUB_ENV
- name: Set Version from manual input
if: github.event_name == 'workflow_dispatch'
run: |
echo "Using version ${{ github.event.inputs.version }}"
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Set up .NET 6 (for PupNet)
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Install PupNet
run: |
sudo apt-get -y install libfuse2
dotnet tool install --framework net6.0 -g KuiperZone.PupNet
- name: Set up .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: PupNet Build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pupnet -r linux-x64 -c Release --kind appimage --app-version $RELEASE_VERSION --clean -y
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: StabilityMatrix-${{ env.platform-id }}
path: ./out/${{ env.out-name }}
release-windows:
if: github.repository == 'ionite34/StabilityMatrix' || github.event_name == 'workflow_dispatch'
name: Release (win-x64)
env:
platform-id: win-x64
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: olegtarasov/get-tag@v2.1.2
if: github.event_name == 'release'
id: tag_name
with:
tagRegex: "v(.*)"
- name: Set Version from Tag
if: github.event_name == 'release'
run: |
echo "Using tag ${{ env.GIT_TAG_NAME }}"
echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}" >> $env:GITHUB_ENV
- name: Set Version from manual input
if: github.event_name == 'workflow_dispatch'
run: |
echo "Using version ${{ github.event.inputs.version }}"
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $env:GITHUB_ENV
- name: Set up .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Install dependencies
run: dotnet restore
- name: .NET Publish
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: >
dotnet publish ./StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
-o out -c Release -r ${{ env.platform-id }}
-p:Version=$env:RELEASE_VERSION
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
-p:PublishTrimmed=true
-p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
-p:SentryUploadSymbols=true -p:SentryUploadSources=true
- name: Post Build
run: mv ./out/StabilityMatrix.Avalonia.exe ./out/${{ env.out-name }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: StabilityMatrix-${{ env.platform-id }}
path: ./out/${{ env.out-name }}
- name: Create Sentry release
if: ${{ github.event_name == 'release' || github.event.inputs.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 }}
cleanup:
name: Artifact Cleanup
needs: [release-linux, release-windows]
if: github.repository == 'ionite34/StabilityMatrix'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
age: '1 hour'
skip-recent: 2
skip-tags: false
- name: Output
if: always() && true
run: exit 0