-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (103 loc) · 4.3 KB
/
release.yml
File metadata and controls
127 lines (103 loc) · 4.3 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: .NET CD - Release
# This workflow runs manually or when a new release is created
on:
workflow_dispatch: # Allows manual triggering
release:
types: [created]
jobs:
build-release:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
# Create binaries for multiple platforms
- name: Publish for Windows
run: dotnet publish BCFileDecryptor/BCFileDecryptor.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true -o publish/win-x64
- name: Publish for Linux
run: dotnet publish BCFileDecryptor/BCFileDecryptor.csproj -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true -o publish/linux-x64
- name: Publish for macOS
run: dotnet publish BCFileDecryptor/BCFileDecryptor.csproj -c Release -r osx-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true -o publish/osx-x64
# Upload raw build output for the packaging job
- name: Upload Windows build output
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: windows-build-output
path: publish/win-x64/
retention-days: 1
- name: Upload Linux build output
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: linux-build-output
path: publish/linux-x64/
retention-days: 1
- name: Upload macOS build output
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: macos-build-output
path: publish/osx-x64/
retention-days: 1
package:
name: Package and Publish
needs: build-release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
# Download build outputs from the build job
- name: Download Windows build
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: windows-build-output
path: publish/win-x64/
- name: Download Linux build
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: linux-build-output
path: publish/linux-x64/
- name: Download macOS build
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: macos-build-output
path: publish/osx-x64/
# Create zip archives for each platform
- name: Zip Windows build
run: cd publish/win-x64 && zip -r ../../BCFileDecryptor-windows.zip *
- name: Zip Linux build
run: cd publish/linux-x64 && zip -r ../../BCFileDecryptor-linux.zip *
- name: Zip macOS build
run: cd publish/osx-x64 && zip -r ../../BCFileDecryptor-macos.zip *
# Upload artifacts for download from the Actions tab
- name: Upload Windows artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: BCFileDecryptor-windows
path: BCFileDecryptor-windows.zip
retention-days: 30
- name: Upload Linux artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: BCFileDecryptor-linux
path: BCFileDecryptor-linux.zip
retention-days: 30
- name: Upload macOS artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: BCFileDecryptor-macos
path: BCFileDecryptor-macos.zip
retention-days: 30
# If this was triggered by a release, attach the binaries to the release
- name: Upload binaries to release
if: github.event_name == 'release'
uses: AButler/upload-release-assets@ec6d3263266dc57eb6645b5f75e827987f7c217d # v2.0
with:
files: 'BCFileDecryptor-*.zip'
repo-token: ${{ secrets.GITHUB_TOKEN }}