Skip to content

Build Release (Stable) #10

Build Release (Stable)

Build Release (Stable) #10

Workflow file for this run

name: Build Release (Stable)
on:
release:
types:
- released
jobs:
cli-framework-stable:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '8.x' ]
name: Build CLI — Framework dependent (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
./.github/workflows/ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
./.github/workflows/ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
./.github/workflows/ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release --no-self-contained Shoko.CLI /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="\"channel=stable,commit=${{ github.sha }},tag=${{ steps.release_info.outputs.tag }},date=${{ steps.release_info.outputs.date }},\""
- name: Archive Release
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0\\publish .\\Shoko.CLI_Framework_any-x64.zip
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.CLI*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
cli-standalone-stable:
runs-on: ubuntu-latest
strategy:
matrix:
rid: ['win-x64', 'linux-x64', 'linux-arm64']
dotnet: [ '8.x' ]
name: Build CLI — Standalone ${{ matrix.rid }} (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
./.github/workflows/ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
./.github/workflows/ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
./.github/workflows/ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: ${{ matrix.rid == 'linux-arm64' }}
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release -r ${{ matrix.rid }} Shoko.CLI /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="\"channel=stable,commit=${{ github.sha }},tag=${{ steps.release_info.outputs.tag }},date=${{ steps.release_info.outputs.date }},\""
- name: Archive Release (${{ matrix.rid }})
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0\\${{ matrix.rid }}\\publish .\\Shoko.CLI_Standalone_${{ matrix.rid }}.zip
- name: Upload Release (${{ matrix.rid }})
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.CLI*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
- name: Upload Artifact to shokoanime.com
if: ${{ matrix.rid != 'win-x64' }}
shell: pwsh
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_SERVER: ${{ secrets.FTP_SERVER }}
run:
.\\.github\\workflows\\UploadRelease.ps1 -remote "ShokoServer-${{ steps.release_info.outputs.version_short }}-${{ matrix.rid }}.zip" -local "Shoko.CLI_Standalone_${{ matrix.rid }}.zip";
tray-service-framework-stable:
runs-on: windows-2022
strategy:
matrix:
dotnet: [ '8.x' ]
name: Build Tray Service — Framework dependent (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
.\\.github\\workflows\\ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
.\\.github\\workflows\\ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
.\\.github\\workflows\\ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release -r win-x64 --no-self-contained Shoko.TrayService /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="channel=stable%2ccommit=${{ github.sha }}%2ctag=${{ steps.release_info.outputs.tag }}%2cdate=${{ steps.release_info.outputs.date }}%2c" # %2c is comma, blame windows/pwsh
- name: Archive Release
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0-windows\\win-x64\\publish .\\Shoko.TrayService_Framework_win-x64.zip
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.TrayService*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
tray-service-standalone-stable:
runs-on: windows-2022
strategy:
matrix:
dotnet: [ '8.x' ]
name: Build Tray Service — Standalone (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
.\\.github\\workflows\\ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
.\\.github\\workflows\\ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
.\\.github\\workflows\\ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release -r win-x64 --self-contained true Shoko.TrayService /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="channel=stable%2ccommit=${{ github.sha }}%2ctag=${{ steps.release_info.outputs.tag }}%2cdate=${{ steps.release_info.outputs.date }}%2c" # %2c is comma, blame windows/pwsh
- name: Archive Release
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0-windows\\win-x64\\publish .\\Shoko.TrayService_Standalone_win-x64.zip
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.TrayService*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
- name: Build Installer
run: iscc /O".\\" ".\\Installer\\ShokoServer.iss"
- name: Upload Installer to GitHub
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.Setup.exe
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
- name: Upload Installer to shokoanime.com
shell: pwsh
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_SERVER: ${{ secrets.FTP_SERVER }}
run:
.\\.github\\workflows\\UploadRelease.ps1 -remote "ShokoServer-${{ steps.release_info.outputs.version_short }}-Win.exe" -local "Shoko.Setup.exe";
sentry-upload:
runs-on: ubuntu-latest
needs:
- cli-framework-stable
- cli-standalone-stable
- tray-service-framework-stable
- tray-service-standalone-stable
name: Upload version info to Sentry.io
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Push Sentry release "${{ steps.release_info.outputs.version }}"
uses: getsentry/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# SENTRY_URL: https://sentry.io/
with:
environment: 'stable'
version: ${{ steps.release_info.outputs.version }}