Skip to content

Merge pull request #15 from RiisDev/dev #72

Merge pull request #15 from RiisDev/dev

Merge pull request #15 from RiisDev/dev #72

Workflow file for this run

name: Build & Test
on:
push:
branches:
- main
paths:
- '**/*.csproj'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
dotnet-version: [ '8.*' ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is fetched for tags
- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.*'
- name: Restore dependencies
run: dotnet restore RadiantConnect.csproj
- name: Restore SNK file from secret
run: |
echo $env:SNK_KEY > key.txt && certutil -decode key.txt RadiantConnectKey.snk
env:
SNK_KEY: ${{ secrets.SNK_KEY }}
- name: Build the project
run: dotnet build RadiantConnect.csproj --configuration Release --framework net8.0
- name: Test RadiantConnect.Tests
run: dotnet test RadiantConnect.Tests/RadiantConnect.Tests.csproj --no-restore --verbosity normal
- name: Publish the project
run: dotnet publish RadiantConnect.csproj --configuration Release --framework net8.0 --output ./bin/Release/net8.0/publish
- name: Create Artifact
uses: actions/upload-artifact@v4
with:
name: published-files
path: ./bin/Release/net8.0/publish/
- name: Zip Artifact For Pre-Release
run: Compress-Archive -Path ./bin/Release/net8.0/publish* -DestinationPath ./RadiantConnect.zip
- name: Create GitHub Pre-Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: pre-release-${{ github.run_number }}
release_name: "Beta Pre-Build ${{ github.run_number }}"
draft: false
prerelease: true
files: ./RadiantConnect.zip
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}