Skip to content

Commit

Permalink
int - Added release canary workflow
Browse files Browse the repository at this point in the history
---

The release canary workflow pushes to GitHub Package Registry.

---

Type: int
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 5, 2025
1 parent 1663530 commit a6b3fce
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 91 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/build-rel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,48 +40,4 @@ jobs:
with:
name: unit-test-log-ms-${{ matrix.runs-on }}
path: "private/Nitrocid.Tests/KSTest/net8.0/TestResults"

wix-amd64:
strategy:
fail-fast: false
runs-on: "windows-latest"

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Solution Compilation
run: cd tools ; ./build.cmd ; cd ..
- name: Installer Solution Compilation
run: dotnet build -p:Configuration=Release -p:Platform=x64 public/Nitrocid.Installers/Nitrocid.Installer.sln
- uses: actions/upload-artifact@v4
with:
name: installer-x64-msi
path: "public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/x64/Release"

wix-arm64:
strategy:
fail-fast: false
runs-on: "windows-latest"

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Solution Compilation
run: cd tools ; ./build.cmd ; cd ..
- name: Installer Solution Compilation
run: dotnet build -p:Configuration=Release -p:Platform=ARM64 public/Nitrocid.Installers/Nitrocid.Installer.sln
- uses: actions/upload-artifact@v4
with:
name: installer-arm64-msi
path: "public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/ARM64/Release"

44 changes: 0 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,48 +40,4 @@ jobs:
with:
name: unit-test-log-ms-${{ matrix.runs-on }}
path: "private/Nitrocid.Tests/KSTest/net8.0/TestResults"

wix-amd64:
strategy:
fail-fast: false
runs-on: "windows-latest"

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Solution Compilation
run: cd tools ; ./build.cmd Debug ; cd ..
- name: Installer Solution Compilation
run: dotnet build -p:Platform=x64 public/Nitrocid.Installers/Nitrocid.Installer.sln
- uses: actions/upload-artifact@v4
with:
name: installer-x64-msi
path: "public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/x64/Debug"

wix-arm64:
strategy:
fail-fast: false
runs-on: "windows-latest"

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Solution Compilation
run: cd tools ; ./build.cmd Debug ; cd ..
- name: Installer Solution Compilation
run: dotnet build -p:Platform=ARM64 public/Nitrocid.Installers/Nitrocid.Installer.sln
- uses: actions/upload-artifact@v4
with:
name: installer-arm64-msi
path: "public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/ARM64/Debug"

59 changes: 59 additions & 0 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Prepare release (canary)

on:
push:
branches: [ "main", "v0.1.0.x-saas", "v0.1.1.x-saas", "v0.1.2.x-saas" ]
pull_request:
branches: [ "main", "v0.1.0.x-saas", "v0.1.1.x-saas", "v0.1.2.x-saas" ]

jobs:
build:

runs-on: windows-latest
permissions:
id-token: write
contents: write
attestations: write
packages: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup DocFX
run: dotnet tool install --global docfx
- name: Release Asset Preparation
run: |
cd tools ; cmd.exe /c "build.cmd Debug -p:ContinuousIntegrationBuild=true" ; cd ..
cd tools ; cmd.exe /c "pack.cmd" ; cd ..
cd tools ; cmd.exe /c "docgen.cmd" ; cd ..
cd tools ; cmd.exe /c "docgen-pack.cmd" ; cd ..
dotnet build -p:Configuration=Debug -p:Platform=x64 public/Nitrocid.Installers/Nitrocid.Installer.sln
dotnet build -p:Configuration=Debug -p:Platform=ARM64 public/Nitrocid.Installers/Nitrocid.Installer.sln
Move-Item public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/x64/Debug/Nitrocid.InstallerBundle.exe tools/nitrocid-win-x64-installer.exe
Move-Item public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/ARM64/Debug/Nitrocid.InstallerBundle.exe tools/nitrocid-win-arm64-installer.exe
- uses: actions/upload-artifact@v4
with:
name: installer-x64-msi
path: "public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/x64/Release"
- uses: actions/upload-artifact@v4
with:
name: installer-arm64-msi
path: "public/Nitrocid.Installers/Nitrocid.InstallerBundle/bin/ARM64/Release"
- uses: actions/upload-artifact@v4
with:
name: nks-build
path: "public/Nitrocid/KSBuild"
- uses: actions/upload-artifact@v4
with:
name: nks-analyzer
path: "public/Nitrocid/KSAnalyzer"
- name: Package Publication
run: |
dotnet nuget add source --username AptiviCEO --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Aptivi/index.json"
chmod +x tools/*.sh
cd tools ; cmd.exe /C "push.cmd ${{ secrets.GITHUB_TOKEN }} github" ; cd ..
4 changes: 3 additions & 1 deletion tools/push.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@echo off
set apikey=%1
set source=%2
if "%source%" == "" set source=nuget.org

REM This script pushes. Use when you have VS installed.
echo Pushing...
cmd /C "forfiles /s /m *.nupkg /p ..\ /C "cmd /c dotnet nuget push @path --api-key %apikey% --source nuget.org""
cmd /C "forfiles /s /m *.nupkg /p ..\ /C "cmd /c dotnet nuget push @path --api-key %apikey% --source %source%""
if %errorlevel% == 0 goto :success
echo There was an error trying to push (%errorlevel%).
goto :finished
Expand Down
8 changes: 6 additions & 2 deletions tools/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ checkerror() {
# This script pushes. Use when you have dotnet installed.
dotnetpath=`which dotnet`
checkerror $? "dotnet is not found"
nugetsource=$1
if [ -z $nugetsource ]; then
nugetsource=nuget.org
fi

# Push packages
echo Pushing packages...
find ../public/Nitrocid/KSBuild/ -maxdepth 1 -type f -name "*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "nuget.org" \;
find ../public/Nitrocid/KSBuild/ -maxdepth 1 -type f -name "*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "$nugetsource" \;
checkerror $? "Failed to push"
find ../public/Nitrocid/KSAnalyzer/ -maxdepth 1 -type f -name "*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "nuget.org" \;
find ../public/Nitrocid/KSAnalyzer/ -maxdepth 1 -type f -name "*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "$nugetsource" \;
checkerror $? "Failed to push"

# Inform success
Expand Down

0 comments on commit a6b3fce

Please sign in to comment.