1
1
---
2
- name : ' Compile, bundle and release the tools'
2
+ name : " Compile, bundle and release the tools"
3
3
4
4
on :
5
- push : { branches: [ ' main' ] }
6
- pull_request : { branches: [ ' main' ] }
5
+ push : { branches: [" main" ] }
6
+ pull_request : { branches: [" main" ] }
7
7
8
8
jobs :
9
9
csharp :
10
- runs-on : ' windows-2019'
10
+ runs-on : " windows-2019"
11
11
strategy :
12
12
matrix :
13
13
project :
14
- - ' DCSyncer'
15
- - ' Rubeus'
16
- - ' Seatbelt'
17
- - ' SharPersist'
18
- - ' SharpUp'
14
+ - " DCSyncer"
15
+ - " Rubeus"
16
+ - " Seatbelt"
17
+ - " SharPersist"
18
+ - " SharpUp"
19
19
steps :
20
- - name : ' Checkout code'
21
- uses : ' actions/checkout@v4'
20
+ - name : " Checkout code"
21
+ uses : " actions/checkout@v4"
22
22
with :
23
23
fetch-depth : 1
24
- submodules : ' recursive'
24
+ submodules : " recursive"
25
25
26
- - name : ' Setup MSBuild'
27
- uses : ' microsoft/setup-msbuild@v2'
26
+ - name : " Setup MSBuild"
27
+ uses : " microsoft/setup-msbuild@v2"
28
28
29
- - name : ' Setup NuGeet'
30
- uses : ' NuGet/setup-nuget@v2'
29
+ - name : " Setup NuGeet"
30
+ uses : " NuGet/setup-nuget@v2"
31
31
32
- - name : ' Restore the solution'
33
- run : ' nuget restore ${{ matrix.project }}.sln'
34
- working-directory : ' windows/${{ matrix.project }}'
32
+ - name : " Restore the solution"
33
+ run : " nuget restore ${{ matrix.project }}.sln"
34
+ working-directory : " windows/${{ matrix.project }}"
35
35
36
36
# yamllint disable rule:indentation rule:line-length
37
- - name : ' Pre-hooks'
37
+ - name : " Pre-hooks"
38
38
run : |
39
39
# SharPersist
40
40
if ('${{ matrix.project }}' -eq 'SharPersist') {
@@ -45,72 +45,72 @@ jobs:
45
45
nuget install Costura.Fody -Version 3.3.3 -Source 'https://api.nuget.org/v3/index.json' -OutputDirectory '.\packages'
46
46
nuget install TaskScheduler -Version 2.8.11 -Source 'https://api.nuget.org/v3/index.json' -OutputDirectory '.\packages'
47
47
}
48
- working-directory : ' windows/${{ matrix.project }}'
49
- if : ' success() || failure()'
48
+ working-directory : " windows/${{ matrix.project }}"
49
+ if : " success() || failure()"
50
50
# yamllint enable rule:indentation rule:line-length
51
51
52
- - name : ' Build the solution'
52
+ - name : " Build the solution"
53
53
run : |
54
54
msbuild /m /t:Build /p:Configuration=Release /p:Platform="Any CPU"
55
55
if (-not $?) { msbuild /m /t:Build /p:Configuration=Release /p:Platform="x64" }
56
56
Get-ChildItem -Path . -Recurse -Filter *.exe | Move-Item -Destination . -Force
57
- working-directory : ' windows/${{ matrix.project }}'
57
+ working-directory : " windows/${{ matrix.project }}"
58
58
59
- - name : ' Archive the artifacts'
60
- uses : ' actions/upload-artifact@v4'
59
+ - name : " Archive the artifacts"
60
+ uses : " actions/upload-artifact@v4"
61
61
with :
62
- name : ' ${{ matrix.project }}'
63
- path : ' windows/${{ matrix.project }}/*.exe'
64
- if-no-files-found : ' error'
62
+ name : " ${{ matrix.project }}"
63
+ path : " windows/${{ matrix.project }}/*.exe"
64
+ if-no-files-found : " error"
65
65
66
66
powershell :
67
- runs-on : ' ubuntu-latest'
67
+ runs-on : " ubuntu-latest"
68
68
strategy :
69
69
matrix :
70
70
project :
71
- - ' Get-ServiceACL'
72
- - ' MailSniper'
73
- - ' Powercat'
74
- - ' PowerLurk'
75
- - ' PowerSharpPack'
76
- - ' PowerSploit'
71
+ - " Get-ServiceACL"
72
+ - " MailSniper"
73
+ - " Powercat"
74
+ - " PowerLurk"
75
+ - " PowerSharpPack"
76
+ - " PowerSploit"
77
77
steps :
78
- - name : ' Checkout code'
79
- uses : ' actions/checkout@v4'
78
+ - name : " Checkout code"
79
+ uses : " actions/checkout@v4"
80
80
with :
81
81
fetch-depth : 1
82
- submodules : ' recursive'
82
+ submodules : " recursive"
83
83
84
- - name : ' Copy all the PWSH scripts'
84
+ - name : " Copy all the PWSH scripts"
85
85
run : |
86
86
mkdir -p /tmp/${{ matrix.project }}
87
87
find . -type f -name '*.ps1' -exec cp {} /tmp/${{ matrix.project }}/ \;
88
- working-directory : ' windows/${{ matrix.project }}'
88
+ working-directory : " windows/${{ matrix.project }}"
89
89
90
- - name : ' Archive the artifacts'
91
- uses : ' actions/upload-artifact@v4'
90
+ - name : " Archive the artifacts"
91
+ uses : " actions/upload-artifact@v4"
92
92
with :
93
- name : ' ${{ matrix.project }}'
94
- path : ' /tmp/${{ matrix.project }}/'
95
- if-no-files-found : ' error'
93
+ name : " ${{ matrix.project }}"
94
+ path : " /tmp/${{ matrix.project }}/"
95
+ if-no-files-found : " error"
96
96
97
97
windows-bundle :
98
- runs-on : ' ubuntu-latest'
99
- needs : [ ' csharp', ' powershell' ]
98
+ runs-on : " ubuntu-latest"
99
+ needs : [" csharp", " powershell" ]
100
100
steps :
101
- - name : ' Download csharp artifacts'
102
- uses : ' actions/download-artifact@v4'
101
+ - name : " Download csharp artifacts"
102
+ uses : " actions/download-artifact@v4"
103
103
with :
104
- path : ' /tmp/bundle/'
105
- pattern : ' * '
104
+ path : " /tmp/bundle/"
105
+ pattern : " * "
106
106
merge-multiple : false
107
107
108
- - name : ' Remove the temporary artifacts'
109
- uses : ' geekyeggo/delete-artifact@v5'
108
+ - name : " Remove the temporary artifacts"
109
+ uses : " geekyeggo/delete-artifact@v5"
110
110
with :
111
- name : ' * '
111
+ name : " * "
112
112
113
- - name : ' Extra steps'
113
+ - name : " Extra steps"
114
114
run : |
115
115
# Rubeus
116
116
echo 'Copying the Rubeus powershell version to Rubeus directory'
@@ -127,13 +127,55 @@ jobs:
127
127
# SharpUp
128
128
echo 'Copying the SharpUp powershell version to SharpUp directory'
129
129
cp ./PowerSharpPack/Invoke-SharpUp.ps1 ./SharpUp/
130
- working-directory : ' /tmp/bundle/'
130
+ working-directory : " /tmp/bundle/"
131
131
132
- - name : ' Upload the final artifact'
133
- uses : ' actions/upload-artifact@v4'
132
+ - name : " Upload the final artifact"
133
+ uses : " actions/upload-artifact@v4"
134
134
with :
135
- if-no-files-found : ' error'
136
- name : ' hackpack-windows.zip'
137
- path : ' /tmp/bundle/'
135
+ if-no-files-found : " error"
136
+ name : " hackpack-windows.zip"
137
+ path : " /tmp/bundle/"
138
138
compression-level : 9
139
+
140
+ release :
141
+ runs-on : " ubuntu-latest"
142
+ needs : ["windows-bundle"]
143
+ permissions :
144
+ contents : " write"
145
+ steps :
146
+ - name : " Checkout code"
147
+ uses : " actions/checkout@v4"
148
+ with :
149
+ fetch-depth : 1
150
+
151
+ - name : " Download the Windows artifact"
152
+ uses : " actions/download-artifact@v4"
153
+ with :
154
+ name : " hackpack-windows.zip"
155
+ path : " /tmp/windows"
156
+
157
+ - name : " Zip the artifacts"
158
+ run : " /usr/bin/zip -r /tmp/hackpack-windows.zip ."
159
+ working-directory : " /tmp/windows"
160
+
161
+ - name : " Delete older releases"
162
+ uses : " jay2610/delete-older-releases@1.4.0"
163
+ with :
164
+ keep_latest : 0
165
+ delete_tags : true
166
+ env :
167
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
168
+
169
+ - name : " Release the artifacts"
170
+ uses : " softprops/action-gh-release@v2"
171
+ with :
172
+ name : " 🎒 Hackpack!"
173
+ tag_name : " latest"
174
+ body_path : " README.md"
175
+ make_latest : true
176
+ files : |-
177
+ /tmp/hackpack-windows.zip
178
+ draft : false
179
+ prerelease : false
180
+ token : " ${{ secrets.GITHUB_TOKEN }}"
139
181
...
0 commit comments