Compare commits
20
Commits
7d330e9368
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c4ad861621 | |||
| 66d0819632 | |||
| 66ea0f90b6 | |||
| e11ac2fdde | |||
| ca626310df | |||
| ece48eb79b | |||
| c573639d96 | |||
| 02a65a6ce0 | |||
| 2490fb260d | |||
| c4d573a69e | |||
| 3fb20e57d1 | |||
| 59b623c170 | |||
| b52ae3ce03 | |||
| c7ec07cef2 | |||
| f41e83765a | |||
| 2e943882ec | |||
| e11c689602 | |||
| 320fee57b2 | |||
| 2b848baa33 | |||
| 9065d614e1 |
@@ -3,37 +3,59 @@ name: Nightly Build and Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-releases:
|
build-releases:
|
||||||
name: 'Build and Release Nightly'
|
name: 'Build and Release Nightly'
|
||||||
runs-on: debian-x86
|
runs-on: Debian-x86
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # Ensures the GITHUB_TOKEN has permission to create/update releases
|
contents: write
|
||||||
container:
|
|
||||||
image: mcr.microsoft.com/dotnet/sdk:9.0
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# 1. Run your custom MSBuild target
|
- name: Setup .NET 11.0
|
||||||
- name: 'Execute .NET Publish Target'
|
uses: actions/setup-dotnet@v4
|
||||||
run: dotnet build aeqw89.tools.Publish/aeqw89.tools.Publish.csproj -t:PublishAll
|
with:
|
||||||
|
dotnet-version: '11.0.100-preview.4.26230.115'
|
||||||
|
|
||||||
|
# Authenticate with your private Gitea NuGet registry
|
||||||
|
- name: Add Gitea NuGet Source
|
||||||
|
run: |
|
||||||
|
dotnet nuget remove source "GiteaRegistry" || true
|
||||||
|
dotnet nuget add source "https://git.main.qwsdcvghyu.com/api/packages/riley/nuget/index.json" --name "GiteaRegistry" --username "riley" --password "${{ secrets.PACKAGES_KEY }}" --store-password-in-clear-text
|
||||||
|
|
||||||
|
- name: 'Execute .NET Publish Target'
|
||||||
|
run: dotnet build aeqw89.tools.Publish/aeqw89.tools.Publish.csproj -p:ArchiveVersion=nightly -t:Archive
|
||||||
|
|
||||||
|
# 1. Clean the release database and forcefully advance the tag
|
||||||
|
- name: Clean up Release & Update Tag
|
||||||
|
run: |
|
||||||
|
# Find and delete the old Gitea Release payload via API
|
||||||
|
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/nightly | jq -r '.id')
|
||||||
|
if [ "$RELEASE_ID" != "null" ] && [ -n "$RELEASE_ID" ]; then
|
||||||
|
echo "Deleting old release ID: $RELEASE_ID"
|
||||||
|
curl -s -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.api_url }}/repos/${{ github.repository }}/releases/$RELEASE_ID
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Force the 'nightly' Git tag to point to this new commit and push it
|
||||||
|
git tag -f nightly ${{ github.sha }}
|
||||||
|
git push -f origin nightly
|
||||||
|
|
||||||
# 2. Upload all generated archives to the 'nightly' release
|
|
||||||
- name: Update Nightly Release
|
- name: Update Nightly Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: nightly
|
tag_name: nightly
|
||||||
|
target_commitish: ${{ github.sha }}
|
||||||
name: "Nightly Development Build"
|
name: "Nightly Development Build"
|
||||||
body: |
|
body: |
|
||||||
Automated rolling nightly build from the latest commit on `main`.
|
Automated rolling nightly build from the latest commit on `main`.
|
||||||
|
|
||||||
**Commit:** ${{ github.sha }}
|
**Commit:** ${{ github.sha }}
|
||||||
prerelease: true
|
prerelease: true
|
||||||
# This glob pattern grabs every zip and tar.gz inside your dist folder
|
|
||||||
files: |
|
files: |
|
||||||
aeqw89.tools.Publish/dist/*.zip
|
aeqw89.tools.Publish/dist/*.zip
|
||||||
aeqw89.tools.Publish/dist/*.tar.gz
|
aeqw89.tools.Publish/dist/*.tar.gz
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ sealed record GitDestination(DestinationContext Context, string Source, string A
|
|||||||
// gitea source structure = https://gitea.example.com/api/packages/{owner}/nuget/index.json
|
// gitea source structure = https://gitea.example.com/api/packages/{owner}/nuget/index.json
|
||||||
var keyResult = GetApiKey("gitea");
|
var keyResult = GetApiKey("gitea");
|
||||||
if (keyResult is ReadableError error) return error;
|
if (keyResult is ReadableError error) return error;
|
||||||
return new GitDestination(context, $"https://gitea.example.com/api/packages/{repoOwner}/nuget/index.json", keyResult.Unwrap(), verbose).Ok();
|
return new GitDestination(context, $"https://git.main.qwsdcvghyu.com/api/packages/{repoOwner}/nuget/index.json", keyResult.Unwrap(), verbose).Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Result<GitDestination, ReadableError> CreateForGithub(DestinationContext context, string repoOwner, bool verbose = false) {
|
public static Result<GitDestination, ReadableError> CreateForGithub(DestinationContext context, string repoOwner, bool verbose = false) {
|
||||||
|
|||||||
@@ -15,10 +15,14 @@
|
|||||||
BuildInParallel="true"
|
BuildInParallel="true"
|
||||||
Properties="Configuration=Release;
|
Properties="Configuration=Release;
|
||||||
Platform=Any CPU;
|
Platform=Any CPU;
|
||||||
TargetFramework=net9.0;
|
TargetFramework=net11.0;
|
||||||
RuntimeIdentifier=%(Rid.Identity);
|
RuntimeIdentifier=%(Rid.Identity);
|
||||||
SelfContained=true;
|
SelfContained=true;
|
||||||
PublishSingleFile=true;
|
PublishSingleFile=true;
|
||||||
|
PublishTrimmed=true;
|
||||||
|
InvariantGlobalization=true;
|
||||||
|
EnableCompressionInSingleFile=true;
|
||||||
|
DebugSymbols=false;
|
||||||
PublishDir=bin\Release\publish\%(Rid.Identity)\" />
|
PublishDir=bin\Release\publish\%(Rid.Identity)\" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net11.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<LangVersion>preview</LangVersion>
|
<LangVersion>preview</LangVersion>
|
||||||
|
|||||||
Reference in New Issue
Block a user