Skip to content

Commit 6fd3259

Browse files
author
Pumita
committed
🎉 Releases!
1 parent a45184d commit 6fd3259

File tree

2 files changed

+119
-71
lines changed

2 files changed

+119
-71
lines changed

.github/workflows/release.yml

Lines changed: 104 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
---
2-
name: 'Compile, bundle and release the tools'
2+
name: "Compile, bundle and release the tools"
33

44
on:
5-
push: { branches: [ 'main' ] }
6-
pull_request: { branches: [ 'main' ] }
5+
push: { branches: ["main"] }
6+
pull_request: { branches: ["main"] }
77

88
jobs:
99
csharp:
10-
runs-on: 'windows-2019'
10+
runs-on: "windows-2019"
1111
strategy:
1212
matrix:
1313
project:
14-
- 'DCSyncer'
15-
- 'Rubeus'
16-
- 'Seatbelt'
17-
- 'SharPersist'
18-
- 'SharpUp'
14+
- "DCSyncer"
15+
- "Rubeus"
16+
- "Seatbelt"
17+
- "SharPersist"
18+
- "SharpUp"
1919
steps:
20-
- name: 'Checkout code'
21-
uses: 'actions/checkout@v4'
20+
- name: "Checkout code"
21+
uses: "actions/checkout@v4"
2222
with:
2323
fetch-depth: 1
24-
submodules: 'recursive'
24+
submodules: "recursive"
2525

26-
- name: 'Setup MSBuild'
27-
uses: 'microsoft/setup-msbuild@v2'
26+
- name: "Setup MSBuild"
27+
uses: "microsoft/setup-msbuild@v2"
2828

29-
- name: 'Setup NuGeet'
30-
uses: 'NuGet/setup-nuget@v2'
29+
- name: "Setup NuGeet"
30+
uses: "NuGet/setup-nuget@v2"
3131

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 }}"
3535

3636
# yamllint disable rule:indentation rule:line-length
37-
- name: 'Pre-hooks'
37+
- name: "Pre-hooks"
3838
run: |
3939
# SharPersist
4040
if ('${{ matrix.project }}' -eq 'SharPersist') {
@@ -45,72 +45,72 @@ jobs:
4545
nuget install Costura.Fody -Version 3.3.3 -Source 'https://api.nuget.org/v3/index.json' -OutputDirectory '.\packages'
4646
nuget install TaskScheduler -Version 2.8.11 -Source 'https://api.nuget.org/v3/index.json' -OutputDirectory '.\packages'
4747
}
48-
working-directory: 'windows/${{ matrix.project }}'
49-
if: 'success() || failure()'
48+
working-directory: "windows/${{ matrix.project }}"
49+
if: "success() || failure()"
5050
# yamllint enable rule:indentation rule:line-length
5151

52-
- name: 'Build the solution'
52+
- name: "Build the solution"
5353
run: |
5454
msbuild /m /t:Build /p:Configuration=Release /p:Platform="Any CPU"
5555
if (-not $?) { msbuild /m /t:Build /p:Configuration=Release /p:Platform="x64" }
5656
Get-ChildItem -Path . -Recurse -Filter *.exe | Move-Item -Destination . -Force
57-
working-directory: 'windows/${{ matrix.project }}'
57+
working-directory: "windows/${{ matrix.project }}"
5858

59-
- name: 'Archive the artifacts'
60-
uses: 'actions/upload-artifact@v4'
59+
- name: "Archive the artifacts"
60+
uses: "actions/upload-artifact@v4"
6161
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"
6565

6666
powershell:
67-
runs-on: 'ubuntu-latest'
67+
runs-on: "ubuntu-latest"
6868
strategy:
6969
matrix:
7070
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"
7777
steps:
78-
- name: 'Checkout code'
79-
uses: 'actions/checkout@v4'
78+
- name: "Checkout code"
79+
uses: "actions/checkout@v4"
8080
with:
8181
fetch-depth: 1
82-
submodules: 'recursive'
82+
submodules: "recursive"
8383

84-
- name: 'Copy all the PWSH scripts'
84+
- name: "Copy all the PWSH scripts"
8585
run: |
8686
mkdir -p /tmp/${{ matrix.project }}
8787
find . -type f -name '*.ps1' -exec cp {} /tmp/${{ matrix.project }}/ \;
88-
working-directory: 'windows/${{ matrix.project }}'
88+
working-directory: "windows/${{ matrix.project }}"
8989

90-
- name: 'Archive the artifacts'
91-
uses: 'actions/upload-artifact@v4'
90+
- name: "Archive the artifacts"
91+
uses: "actions/upload-artifact@v4"
9292
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"
9696

9797
windows-bundle:
98-
runs-on: 'ubuntu-latest'
99-
needs: [ 'csharp', 'powershell' ]
98+
runs-on: "ubuntu-latest"
99+
needs: ["csharp", "powershell"]
100100
steps:
101-
- name: 'Download csharp artifacts'
102-
uses: 'actions/download-artifact@v4'
101+
- name: "Download csharp artifacts"
102+
uses: "actions/download-artifact@v4"
103103
with:
104-
path: '/tmp/bundle/'
105-
pattern: '*'
104+
path: "/tmp/bundle/"
105+
pattern: "*"
106106
merge-multiple: false
107107

108-
- name: 'Remove the temporary artifacts'
109-
uses: 'geekyeggo/delete-artifact@v5'
108+
- name: "Remove the temporary artifacts"
109+
uses: "geekyeggo/delete-artifact@v5"
110110
with:
111-
name: '*'
111+
name: "*"
112112

113-
- name: 'Extra steps'
113+
- name: "Extra steps"
114114
run: |
115115
# Rubeus
116116
echo 'Copying the Rubeus powershell version to Rubeus directory'
@@ -127,13 +127,55 @@ jobs:
127127
# SharpUp
128128
echo 'Copying the SharpUp powershell version to SharpUp directory'
129129
cp ./PowerSharpPack/Invoke-SharpUp.ps1 ./SharpUp/
130-
working-directory: '/tmp/bundle/'
130+
working-directory: "/tmp/bundle/"
131131

132-
- name: 'Upload the final artifact'
133-
uses: 'actions/upload-artifact@v4'
132+
- name: "Upload the final artifact"
133+
uses: "actions/upload-artifact@v4"
134134
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/"
138138
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 }}"
139181
...

.yamllint

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
2+
extends: "default"
3+
yaml-files:
4+
- ".yamllint"
5+
- "*.yml"
6+
- "*.yaml"
7+
ignore: []
28
rules:
39
anchors:
410
forbid-undeclared-aliases: true
@@ -12,8 +18,8 @@ rules:
1218
max-spaces-inside-empty: 0
1319
brackets:
1420
forbid: false
15-
min-spaces-inside: 1
16-
max-spaces-inside: 1
21+
min-spaces-inside: 0
22+
max-spaces-inside: 0
1723
min-spaces-inside-empty: 0
1824
max-spaces-inside-empty: 0
1925
colons:
@@ -48,32 +54,32 @@ rules:
4854
hyphens:
4955
max-spaces-after: 1
5056
indentation:
51-
spaces: 'consistent'
57+
spaces: "consistent"
5258
indent-sequences: true
5359
check-multi-line-strings: true
5460
key-duplicates:
5561
forbid-duplicated-merge-keys: false
56-
key-ordering: 'disable'
62+
key-ordering: "disable"
5763
line-length:
58-
level: 'warning'
59-
max: 120
64+
level: "warning"
65+
max: 130
6066
allow-non-breakable-words: true
6167
allow-non-breakable-inline-mappings: true
6268
new-line-at-end-of-file: {}
6369
new-lines:
64-
type: 'platform'
70+
type: "platform"
6571
octal-values:
6672
forbid-implicit-octal: true
6773
forbid-explicit-octal: true
6874
quoted-strings:
69-
quote-type: 'single'
75+
quote-type: "double"
7076
required: true
7177
extra-required: []
7278
extra-allowed: []
7379
allow-quoted-quotes: true
7480
check-keys: false
7581
trailing-spaces: {}
7682
truthy:
77-
allowed-values: [ 'true', 'false' ]
83+
allowed-values: ["true", "false"]
7884
check-keys: false
7985
...

0 commit comments

Comments
 (0)