-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (58 loc) · 1.98 KB
/
Copy pathdotnet.yml
File metadata and controls
72 lines (58 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: .NET Build and Release
on:
push:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build Windows x64
run: dotnet publish FontGeneratorCLI/FontGeneratorCLI.csproj -c Release -r win-x64 -o ./publish/win-x64
- name: Build Linux x64
run: dotnet publish FontGeneratorCLI/FontGeneratorCLI.csproj -c Release -r linux-x64 -o ./publish/linux-x64
- name: Build Linux ARM64
run: dotnet publish FontGeneratorCLI/FontGeneratorCLI.csproj -c Release -r linux-arm64 -o ./publish/linux-arm64
- name: Generate Tag Name
id: tag_name
run: |
DATE=$(date +'%Y.%m.%d')
COUNT=$(git tag -l "v$DATE*" | wc -l)
if [ $COUNT -eq 0 ]; then
TAG="v$DATE"
else
TAG="v$DATE.$COUNT"
fi
echo "TAG_NAME=$TAG" >> $GITHUB_ENV
echo "final_tag=$TAG" >> $GITHUB_OUTPUT
- name: Zip Artifacts
run: |
zip -j FontGeneratorCLI_win-x64.zip ./publish/win-x64/*
zip -j FontGeneratorCLI_linux-x64.zip ./publish/linux-x64/*
zip -j FontGeneratorCLI_linux-arm64.zip ./publish/linux-arm64/*
- name: Create Tag
run: |
git tag ${{ env.TAG_NAME }}
git push origin ${{ env.TAG_NAME }}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG_NAME }}
name: FontGeneratorCLI ${{ env.TAG_NAME }}
generate_release_notes: true
files: |
FontGeneratorCLI_win-x64.zip
FontGeneratorCLI_linux-x64.zip
FontGeneratorCLI_linux-arm64.zip