-
Notifications
You must be signed in to change notification settings - Fork 807
129 lines (108 loc) · 3.15 KB
/
release.yml
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
128
129
name: "Merlin Server Release"
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
name: 'Release Job'
runs-on: ubuntu-latest
steps:
- name: debug
id: debug
run: |
pwd
echo $HOME
- name: Checkout Merlin
id: checkout_merlin
uses: actions/checkout@v4
- name: debug2
id: debug2
run: |
pwd
ls -la
- name: Checkout Merlin-Agent
id: checkout_merlin_agent
uses: actions/checkout@v4
with:
repository: 'Ne0nd0g/merlin-agent'
path: '/merlin-agent'
- name: debug3
id: debug3
run: |
pwd
ls -la
ls -lah /
- name: Checkout Merlin-Agent-DLL
id: checkout_merlin_agent_dll
uses: actions/checkout@v4
with:
repository: 'Ne0nd0g/merlin-agent-dll'
path: '/merlin-agent-dll'
- name: Checkout Merlin CLI
id: checkout_merlin_cli
uses: actions/checkout@v4
with:
repository: 'Ne0nd0g/merlin-cli'
path: '/merlin-cli'
- name: Set up Go
id: setup_go
uses: actions/setup-go@v4
with:
go-version: '1.21'
# Need 7zip installed to package up the release
- name: Install 7zip
id: install_7zip
run: sudo apt-get install p7zip-full
# Need MingGW installed to build the Agent DLL
- name: Install MingGW
id: install_mingw
run: sudo apt-get install -y -q mingw-w64
- name: Build Merlin Agents
id: build_agents
working-directory: /merlin-agent
run: |
pwd
make distro
- name: Build Merlin Agent DLL
id: build_agent_dll
working-directory: /merlin-agent-dll
run: make default
- name: Move Agents
id: move_agents
working-directory: /merlin
run: |
mkdir -p data/bin
cp /merlin-agent/merlinAgent-* /merlin/data/bin
cp /merlin-agent-dll/merlinAgent.dll /merlin/data/bin
- name: Build Merlin CLI
id: build_cli
working-directory: /merlin-cli
run: make all
- name: Move Agents
id: move_cli
working-directory: /merlin
run: |
cp /merlin-CLI/merlinCLI-* /merlin/data/bin
- name: Build Merlin Server
id: build_server
working-directory: /merlin
run: make distro
- name: Package Release
id: package_release
working-directory: merlin
run: |
F="README.MD LICENSE data/modules docs data/README.MD data/agents/README.MD data/log/README.MD data/x509 data/src data/bin"
7za a -pmerlin -mhe -mx=9 merlinServer-Linux-x64.7z $F merlinCLI-Linux-x64 merlinServer-Linux-x64
- name: Create Draft Release
id: create_draft_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: true
prerelease: false
artifactErrorsFailBuild: true
artifacts: '*.7z'