Skip to content

Renamed the script and the app #32

Renamed the script and the app

Renamed the script and the app #32

name: Build and Release on Tag
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Restore NuGet packages
run: nuget restore app/Guidzgo.sln
- name: Build Release Solution
run: msbuild app/Guidzgo.sln /p:Configuration=Release
working-directory: ${{ github.workspace }}
- name: Build Debug Solution
run: msbuild app/Guidzgo.sln /p:Configuration=Debug
working-directory: ${{ github.workspace }}
- name: Debug Build Output
run: |
if (Test-Path app\Guidzgo\bin\Release) {
Write-Output "Checking Release folder..."
Get-ChildItem app\Guidzgo\bin\Release
} else {
Write-Output "Release folder not found."
}
if (Test-Path app\Guidzgo\bin\Debug) {
Write-Output "Checking Debug folder..."
Get-ChildItem app\Guidzgo\bin\Debug
} else {
Write-Output "Debug folder not found."
}
- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: build-output
path: |
app/Guidzgo/bin/Release/**/*
app/Guidzgo/bin/Debug/**/*
- name: Download External Script
shell: pwsh
run: |
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/mrFavoslav/KeyDrop-BOT/main/script/KeyDropBOT_client.js' `
-Headers @{ Authorization = "token ${{ secrets.GH_TOKEN }}" } `
-OutFile 'KeyDropBOT_client.js'
- name: Rename Release Binary
run: |
if (Test-Path app\Guidzgo\bin\Release\Guidzgo.exe) {
Rename-Item -Path app\Guidzgo\bin\Release\Guidzgo.exe -NewName KeyDrop-BOT_server.exe
} else {
Write-Error "Release binary not found."
}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
app/Guidzgo/bin/Release/KeyDrop-BOT_server.exe
KeyDropBOT_client.js
Source code (zip)
Source code (tar.gz)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}