rdt-client/.github/workflows/build-release.yaml
2025-04-13 09:59:55 -06:00

88 lines
No EOL
2.1 KiB
YAML

name: Release
on:
push:
tags:
- v*
permissions:
packages: write
jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9'
- name: Test Backend
working-directory: server
run: dotnet test
release:
name: Create GitHub release
needs: [test, version]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9'
- name: Build Frontend
working-directory: client
run: |
npm ci
npm run build
- name: Build and Publish Backend
working-directory: server
shell: pwsh
run: |
$v = "${{ needs.version.outputs.version }}".TrimStart('v')
dotnet restore
dotnet build -c Release --no-restore -p:Version=$v -p:AssemblyVersion=$v
dotnet publish RdtClient.Web/RdtClient.Web.csproj -c Release --no-build -p:Version=$v -p:AssemblyVersion=$v -o ../publish
- name: Create ZIP
run: |
cd publish
zip -r ../RealDebridClient.zip .
cd ..
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.version.outputs.version }}
name: ${{ needs.version.outputs.version }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
files: RealDebridClient.zip
token: ${{ secrets.GITHUB_TOKEN }}