Skip to content

Commit 9683ee5

Browse files
authored
Merge pull request #10 from HappyHackingSpace/refactor/go-to-csharp
Refactor/go to csharp
2 parents fe96e5b + 3c20b15 commit 9683ee5

36 files changed

Lines changed: 1694 additions & 852 deletions

.csharpierrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
printWidth: 150

.github/workflows/release-binary.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
include:
16+
- rid: linux-x64
17+
os: ubuntu-latest
18+
- rid: linux-arm64
19+
os: ubuntu-latest
20+
- rid: osx-x64
21+
os: macos-latest
22+
- rid: osx-arm64
23+
os: macos-latest
24+
- rid: win-x64
25+
os: windows-latest
26+
- rid: win-arm64
27+
os: windows-latest
28+
29+
runs-on: ${{ matrix.os }}
30+
31+
steps:
32+
- uses: actions/checkout@v6
33+
34+
- name: Setup .NET
35+
uses: actions/setup-dotnet@v5
36+
with:
37+
dotnet-version: "10.0.x"
38+
dotnet-quality: "ga"
39+
40+
- name: Publish
41+
run: dotnet publish funURL.CLI -c Release -r ${{ matrix.rid }} -o publish
42+
43+
- name: Copy README and LICENSE
44+
shell: pwsh
45+
run: Copy-Item README.md, LICENSE.md -Destination publish/
46+
47+
- name: Archive
48+
shell: pwsh
49+
run: Compress-Archive -Path publish/* -DestinationPath funurl-${{ matrix.rid }}.zip
50+
51+
- name: Upload artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: funurl-${{ matrix.rid }}
55+
path: funurl-${{ matrix.rid }}.zip
56+
57+
- name: Pack platform-specific tool
58+
run: dotnet pack funURL.CLI -c Release -r ${{ matrix.rid }} -o nupkgs
59+
60+
- name: Upload nupkg
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: nupkg-${{ matrix.rid }}
64+
path: nupkgs/*.nupkg
65+
66+
release:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- uses: actions/checkout@v6
72+
73+
- name: Download artifacts
74+
uses: actions/download-artifact@v5
75+
with:
76+
path: artifacts
77+
merge-multiple: true
78+
79+
- name: Determine version
80+
id: version
81+
run: echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
82+
83+
- name: Validate version
84+
run: |
85+
TAG="${{ steps.version.outputs.tag }}"
86+
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
87+
echo "::error::Invalid version tag '$TAG'. Must match semver format (e.g. v1.0.0)."
88+
exit 1
89+
fi
90+
91+
- name: Setup .NET
92+
uses: actions/setup-dotnet@v5
93+
with:
94+
dotnet-version: "10.0.x"
95+
dotnet-quality: "ga"
96+
97+
- name: Extract version from tag
98+
id: pkg_version
99+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
100+
101+
- name: Pack root dotnet tool package
102+
run: dotnet pack funURL.CLI -c Release -p:Version=${{ steps.pkg_version.outputs.version }} -o nupkgs
103+
104+
- name: Push to NuGet
105+
run: |
106+
for pkg in artifacts/nupkg-*/*.nupkg nupkgs/*.nupkg; do
107+
dotnet nuget push "$pkg" \
108+
--api-key ${{ secrets.NUGET_API_KEY }} \
109+
--source https://api.nuget.org/v3/index.json \
110+
--skip-duplicate
111+
done
112+
113+
- name: Create release
114+
env:
115+
GH_TOKEN: ${{ github.token }}
116+
run: >
117+
gh release create "${{ steps.version.outputs.tag }}"
118+
artifacts/*
119+
--title "${{ steps.version.outputs.tag }}"
120+
--generate-notes

0 commit comments

Comments
 (0)