Northstar
Northstar copied to clipboard
Automatic releases for release candidates in designated Discord channel
It would be nice if we could set up a way that automatically posts release candidates to a designated Discord channel in Northstar Discord, upon build.
This would streamline our testing workflow a lot, as currently one needs to manually upload release builds to a channel.
@p0358 what's the hook/bot you currently use to publish r1o releases? ^^
it's a custom-written script in PowerShell since no existing actions were good enough for what we wanted, I can share it when the author agrees (so when he wakes up) (not that it's not gonna be open source eventually anways xD)
Sending build itself is
- id: DiscordSendArtifacts
if: success()
name: Send build to Discord
run: ./.github/discord-webhook-file.ps1 ${{ env.ARTIFACTS_PATH }}
env:
CI_NUM: ${{ matrix.target }}#${{ github.run_number }}
The script
param ($file_path)
$EXT_WHITELIST = "*.exe", "*.dll"
if ($DISCORD_HOOK -isnot [string]) {
$DISCORD_HOOK = $env:DISCORD_HOOK
}
$DiscordArgs = @{}
$DiscordArgs.Add("username", "GitHub Actions")
$DiscordArgs.Add("avatar_url", "https://raw.githubusercontent.com/github/explore/2c7e603b797535e5ad8b4beb575ab3b7354666e1/topics/actions/actions.png")
# $DiscordArgs.Add("content", "`u{2705}CI Run $env:CI_NUM was a success!")
$DiscordArgs.Add("file1", $(Compress-Archive -Path $(Get-ChildItem -Path $file_path -Recurse -Include $EXT_WHITELIST) -PassThru -DestinationPath $env:FILE_NAME))
Invoke-RestMethod -Uri "$($DISCORD_HOOK)?wait=true" -Method Post -form $DiscordArgs -ContentType "multipart/form-data"
written by @OctoNezd
goes without saying you need to supply the env variables:
- DISCORD_HOOK
- ARTIFACTS_PATH
It does on the fly compress the whitelisted extensions from specified dir and uploads that zip file to the channel where the webhook is attached to
The scripts to send and edit build status message are separate, as is combining the artifacts for packaging later in the package repo
Its not exactly on fly - Compress-Archive
always creates zip file. The environment variable FILE_NAME must be specified too iirc.
Related: https://github.com/CooldudePUGS/Spectre/issues/33
Related: itscynxx/Spectre#33
This issue has since been closed as Spectre has support for pinging playtesters now. It can be manually updated by command if something goes wrong, Spectre simply doesn't have perms to ping playtester (which Gecko usually pings them)
Related Spectre pull request: https://github.com/itscynxx/Spectre/pull/44
Yeah, basically between FlightCore supporting release candidates as a release channel and Spectre being able to ping playtesters I'd say this issue can be closed as completed :D