Skip to content

Commit

Permalink
feat(ci): Full build workflow (#1)
Browse files Browse the repository at this point in the history
Implement Shellcode generation and bundling of artifacts
  • Loading branch information
tuxuser authored Jul 31, 2024
1 parent 1071568 commit 78e1c19
Showing 1 changed file with 63 additions and 3 deletions.
66 changes: 63 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build

on:
push:
pull_request:

jobs:
build:
Expand All @@ -10,8 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
component: [shellcode_utils, shellcode_stage1, shellcode_stage1_network, shellcode_stage2, loader, daemon, server, test_program_rust]
features: ["--all-features", ""]
component: [shellcode_utils, loader, shellcode_stage1, shellcode_stage1_network, shellcode_stage2, shellcode_gen, daemon, server]

steps:
- name: Checkout
Expand All @@ -22,4 +22,64 @@ jobs:

- name: Build ${{ matrix.component }}
working-directory: crates/${{ matrix.component }}
run: cargo build --release ${{ matrix.features }}
run: cargo build --release --all-features

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Binaries-${{ matrix.component }}
path: |
README.md
LICENSE
crates/${{ matrix.component }}/target/release/${{ matrix.component }}.exe
crates/${{ matrix.component }}/target/x86_64-pc-windows-msvc/release/${{ matrix.component }}.exe
generate:
name: Generate payloads
runs-on: windows-latest
needs: build
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: .
pattern: Binaries-*
merge-multiple: true
- name: Create output dir
run: mkdir output
- name: Generate payloads
working-directory: crates\shellcode_gen
run: |
.\target\release\shellcode_gen.exe ${{ github.workspace }}\output\
- name: Copy artifact binaries to output directory
run: |
xcopy README.md output\
xcopy LICENSE output\
xcopy crates\daemon\target\release\daemon.exe output\
xcopy crates\server\target\release\server.exe output\
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Release
path: |
output\**
bundle:
name: Bundle
runs-on: windows-latest
needs: [generate]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Release
path: release\

- name: Bundle binaries
run: 7z a -tzip Solstice.zip .\release\**

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: Solstice.zip

0 comments on commit 78e1c19

Please sign in to comment.