Skip to content

Commit

Permalink
int - Roll out CI builds
Browse files Browse the repository at this point in the history
---

This is not done yet!

---

Type: int
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 5, 2025
1 parent 9f903bc commit efc2720
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CodeQL Analysis"

on:
push:
branches: [ "main", "x/oob/4.3.x" ]
branches: [ "main" ]
pull_request:
branches: [ "main", "x/oob/4.3.x" ]
branches: [ "main" ]
schedule:
- cron: '06 12 * * *'

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

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
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: make dbg-ci
- 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 ; NUGET_APIKEY=${{ secrets.GITHUB_TOKEN }} ./push.sh Debug github ; cd ..
17 changes: 14 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<PropertyGroup>
<Version>6.1.4</Version>
<Version>1.2.0</Version>
<Authors>Aptivi</Authors>
<Company>Aptivi</Company>
<Copyright>Copyright (c) 2023-2025 Aptivi</Copyright>
<Copyright>Copyright (c) 2024-2025 Aptivi</Copyright>
<LangVersion>latest</LangVersion>
<DebugType>portable</DebugType>
<Nullable>enable</Nullable>
<SignAssembly>True</SignAssembly>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS9057,CS8002,nullable</WarningsAsErrors>
<EnableSourceControlManagerQueries>true</EnableSourceControlManagerQueries>
<RootPath>$(MSBuildThisFileDirectory)</RootPath>
Expand All @@ -23,4 +23,15 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
<Target Name="EnsureCommitShaInclusion" BeforeTargets="GenerateNuspec" Condition="'$(Configuration)' == 'Debug' And '$(SourceRevisionId)' != '' And '$(ContinuousIntegrationBuild)' == 'true'">
<ReadLinesFromFile File="$(RootPath)/private/BuildTargets/obj/.dtp">
<Output TaskParameter="Lines" ItemName="DateTimePart"/>
</ReadLinesFromFile>
<CreateProperty Value="$(Version)-%(DateTimePart.Identity)+$(SourceRevisionId)">
<Output TaskParameter="Value" PropertyName="PackageVersion"/>
</CreateProperty>
</Target>
<ItemGroup Condition="'$(MSBuildProjectFile)' != 'BuildTargets.csproj'">
<ProjectReference Include="$(RootPath)/private/BuildTargets/BuildTargets.csproj" PrivateAssets="All" />
</ItemGroup>
</Project>
15 changes: 15 additions & 0 deletions private/BuildTargets/BuildTargets.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.Build.NoTargets/3.7.56" DefaultTargets="Build">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<Target Name="DateTimePartAppend" BeforeTargets="Build" Condition="'$(ContinuousIntegrationBuild)' == 'true'">
<PropertyGroup>
<DateTimePart>$([System.DateTime]::Now.ToString('yyyyMMddHHmmss'))</DateTimePart>
</PropertyGroup>
<WriteLinesToFile Overwrite="true" File="$(MSBuildThisFileDirectory)/obj/.dtp" Lines="$(DateTimePart)" />
<Message Importance="high" Text="Building on CI: $(DateTimePart)" />
</Target>

</Project>
22 changes: 3 additions & 19 deletions tools/push.cmd
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
@echo off

REM Terminaux Copyright (C) 2023-2025 Aptivi
REM
REM This file is part of Terminaux
REM
REM Terminaux is free software: you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation, either version 3 of the License, or
REM (at your option) any later version.
REM
REM Terminaux is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with this program. If not, see <https://www.gnu.org/licenses/>.

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
14 changes: 9 additions & 5 deletions tools/push.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

# Terminaux Copyright (C) 2023-2025 Aptivi
#
#
# This file is part of Terminaux
#
#
# Terminaux is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# Terminaux is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand All @@ -31,12 +31,16 @@ releaseconf=$1
if [ -z $releaseconf ]; then
releaseconf=Release
fi
nugetsource=$2
if [ -z $nugetsource ]; then
nugetsource=nuget.org
fi
dotnetpath=`which dotnet`
checkerror $? "dotnet is not found"

# Push packages
echo Pushing packages...
find .. -type f -path "**/bin/$releaseconf/*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "nuget.org" \;
find .. -type f -path "**/bin/$releaseconf/*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "$nugetsource" \;
checkerror $? "Failed to push"

# Inform success
Expand Down

0 comments on commit efc2720

Please sign in to comment.