Skip to content

code cleanup

code cleanup #16

Workflow file for this run

name: main
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Run tests
run: >
dotnet test
--configuration Release
build:
needs: test
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Publish
run: >
dotnet publish NightGlow
-c Release
--output NightGlow/bin/publish/
- name: Create installer
shell: pwsh
run: |
choco install innosetup --no-progress
Copy-Item -Path NightGlow/bin/publish/ -Recurse -Destination Installer/Source/
& "c:\Program Files (x86)\Inno Setup 6\ISCC.exe" Installer/Installer.iss
- name: Upload artifacts (portable)
uses: actions/upload-artifact@v3
with:
name: NightGlow-Portable
path: NightGlow/bin/publish/
- name: Upload artifacts (installer)
uses: actions/upload-artifact@v3
with:
name: NightGlow-Installer
path: Installer/bin/NightGlow-Installer.exe
deploy:
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts (portable)
uses: actions/download-artifact@v3
with:
name: NightGlow-Portable
path: NightGlow
- name: Download artifacts (installer)
uses: actions/download-artifact@v3
with:
name: NightGlow-Installer
- name: Create package (portable)
shell: pwsh
run: >
Compress-Archive
-Path NightGlow
-DestinationPath NightGlow-Portable.zip
-Force
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
gh release create "${{ github.ref_name }}"
"NightGlow-Portable.zip"
"NightGlow-Installer.exe"
--repo "${{ github.event.repository.full_name }}"
--title "${{ github.ref_name }}"
--notes "[Changelog](${{ github.event.repository.html_url }}/blob/${{ github.ref_name }}/CHANGELOG.md)"
--verify-tag