Updated version to v2.1.2 #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Merlin Server Release" | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
release: | |
name: 'Release Job' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Merlin | |
id: checkout_merlin | |
uses: actions/checkout@v4 | |
- name: Checkout Merlin-Agent | |
id: checkout_merlin_agent | |
run: git clone https://github.com/Ne0nd0g/merlin-agent.git /home/runner/work/merlin-agent | |
- name: Checkout Merlin-Agent-DLL | |
id: checkout_merlin_agent_dll | |
run: git clone https://github.com/Ne0nd0g/merlin-agent-dll.git /home/runner/work/merlin-agent-dll | |
- name: Checkout Merlin CLI | |
id: checkout_merlin_cli | |
run: git clone https://github.com/Ne0nd0g/merlin-cli.git /home/runner/work/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: /home/runner/work/merlin-agent | |
run: | | |
VERSION=$(cat ./core/core.go |grep "var Version ="|cut -d"\"" -f2) | |
BUILD=$(git rev-parse HEAD) | |
DIR=bin/v${VERSION}/${BUILD} | |
make all | |
mv $DIR/merlinAgent-* . | |
- name: Build Merlin Agent DLL | |
id: build_agent_dll | |
working-directory: /home/runner/work/merlin-agent-dll | |
run: make default | |
- name: Move Agents | |
id: move_agents | |
working-directory: /home/runner/work/merlin/merlin | |
run: | | |
mkdir -p data/bin | |
cp /home/runner/work/merlin-agent/merlinAgent-* ./data/bin | |
cp /home/runner/work/merlin-agent-dll/merlin.dll ./data/bin | |
- name: Build Merlin CLI | |
id: build_cli | |
working-directory: /home/runner/work/merlin-cli | |
run: make release | |
- name: Move Merlin CLI | |
id: move_cli | |
working-directory: /home/runner/work/merlin/merlin | |
run: | | |
cp /home/runner/work/merlin-cli/merlinCLI-* ./data/bin | |
- name: Build Merlin Server | |
id: build_server | |
working-directory: /home/runner/work/merlin/merlin | |
run: make distro | |
- name: Package Release | |
id: package_release | |
working-directory: /home/runner/work/merlin/merlin | |
run: | | |
VERSION=$(cat pkg/merlin.go |grep "const Version ="|cut -d"\"" -f2) | |
BUILD=$(git rev-parse HEAD) | |
DIR=data/temp/v${VERSION}/${BUILD} | |
cp docs/CHANGELOG.MD . | |
cp $DIR/merlinServer* . | |
F="LICENSE data/modules CHANGELOG.MD 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 merlinServer-Linux-x64 | |
7za a -pmerlin -mhe -mx=9 merlinServer-Darwin-x64.7z $F merlinServer-Darwin-x64 | |
7za a -pmerlin -mhe -mx=9 merlinServer-Windows-x64.7z $F merlinServer-Windows-x64.exe | |
- 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' |