Skip to content

Commit d78d438

Browse files
Add release.yml to publish attested artifacts
1 parent c1ad895 commit d78d438

2 files changed

Lines changed: 76 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
id-token: write
12+
attestations: write
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '10.0.x'
26+
27+
- name: Build ucll.build tool
28+
run: dotnet build src/ucll.build/ucll.build.csproj
29+
30+
- name: Run ucll.build to create release artifacts
31+
env:
32+
SKIP_GPG_SIGNING: 'true'
33+
run: dotnet run --project src/ucll.build/ucll.build.csproj --no-build
34+
35+
- name: List artifacts
36+
run: ls -lah src/ucll.build/bin/artifacts/
37+
38+
- name: Upload artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: release-artifacts
42+
path: src/ucll.build/bin/artifacts/*
43+
if-no-files-found: error
44+
45+
- name: Attest build provenance
46+
uses: actions/attest-build-provenance@v3
47+
with:
48+
subject-path: src/ucll.build/bin/artifacts/*
49+
50+
- name: Create GitHub Release
51+
uses: softprops/action-gh-release@v2
52+
if: startsWith(github.ref, 'refs/tags/')
53+
with:
54+
files: |
55+
src/ucll.build/bin/artifacts/ucll-osx-arm64.tar.gz
56+
src/ucll.build/bin/artifacts/ucll-osx-x64.tar.gz
57+
src/ucll.build/bin/artifacts/ucll-linux-arm64.tar.gz
58+
src/ucll.build/bin/artifacts/ucll-linux-x64.tar.gz
59+
src/ucll.build/bin/artifacts/ucll-win-arm64.zip
60+
src/ucll.build/bin/artifacts/ucll-win-x64.zip
61+
src/ucll.build/bin/artifacts/SHA256SUMS
62+
generate_release_notes: true
63+
prerelease: true
64+
draft: true
65+
make_latest: true

src/ucll.build/Program.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,17 @@
5252
Console.WriteLine($"Created {sha256SumsPath}");
5353
Console.WriteLine();
5454

55-
SignWithGPG(sha256SumsPath);
56-
File.Delete(sha256SumsPath);
55+
// Only sign with GPG if not skipped (e.g., in CI environments)
56+
bool skipGpgSigning = Environment.GetEnvironmentVariable("SKIP_GPG_SIGNING") == "true";
57+
if (skipGpgSigning)
58+
{
59+
Console.WriteLine("Skipping GPG signing (SKIP_GPG_SIGNING=true)");
60+
}
61+
else
62+
{
63+
SignWithGPG(sha256SumsPath);
64+
File.Delete(sha256SumsPath);
65+
}
5766

5867
return 0;
5968

0 commit comments

Comments
 (0)