Skip to content

docs: 2.2.0 docs (#298) #12

docs: 2.2.0 docs (#298)

docs: 2.2.0 docs (#298) #12

Workflow file for this run

name: release
on:
push:
tags:
- 'v*'
env:
GO_VERSION: 1.21.x
WIX_VERSION: 5.0.0
jobs:
build:
runs-on: windows-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v4
- name: Adjust pkg-config prefix
shell: bash
run: |
sed -i 's/C:\/Python37/C:\/hostedtoolcache\/windows\/Python\/3.7.9\/x64/' pkg-config/python-37.pc
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
release: false
install: >-
base-devel
mingw-w64-x86_64-gcc
mingw-w64-x86_64-openssl
mingw-w64-x86_64-pkg-config
git
automake
libtool
autoconf
- name: Cache yara
uses: actions/cache@v4
id: cache
with:
path: |
**/yara
key: ${{ runner.os }}-yara-${{ hashFiles('**/pkg/yara') }}
restore-keys: |
${{ runner.os }}-yara-${{ hashFiles('**/pkg/yara') }}
- name: Clone yara
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
env:
VERSION: "4.2.x"
run: |
git clone --depth 1 --branch $VERSION https://github.com/VirusTotal/yara.git
- name: Configure yara
if: steps.cache.outputs.cache-hit != 'true'
shell: msys2 {0}
run: |
cd yara
autoreconf -fiv
./configure --host=x86_64-w64-mingw32
- name: Install yara
shell: msys2 {0}
run: |
cd yara
make install
- name: Get version
id: get_version
shell: bash
run: |
echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c2-)
- name: Build
shell: bash
run: |
export PATH=/c/msys64/mingw64/bin:$PATH
export PKG_CONFIG_PATH=$(pwd)/pkg-config
export COMMIT=$(echo $GITHUB_SHA | cut -c1-8)
export VERSION=${{ steps.get_version.outputs.VERSION }}
./make.bat rsrc
./make.bat mc
./make.bat
env:
TAGS: kcap,filament,yara,yara_static
- name: Install Wix
shell: bash
run: |
dotnet tool install --global wix --version $WIX_VERSION
- name: Package
shell: bash
run: |
export VERSION=${{ steps.get_version.outputs.VERSION }}
./make.bat pkg
- uses: actions/upload-artifact@v4
with:
name: fibratus-${{ steps.get_version.outputs.VERSION }}-amd64.msi
path: "./build/msi/fibratus-${{ steps.get_version.outputs.VERSION }}-amd64.msi"
build-slim:
runs-on: windows-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v4
- name: Get version
id: get_version
shell: bash
run: |
echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c2-)
- name: Build
shell: bash
run: |
export PATH=/c/msys64/mingw64/bin:$PATH
export COMMIT=$(echo $GITHUB_SHA | cut -c1-8)
export VERSION=${{ steps.get_version.outputs.VERSION }}
./make.bat rsrc
./make.bat mc
./make.bat
- name: Install Wix
shell: bash
run: |
dotnet tool install --global wix --version $WIX_VERSION
- name: Package
shell: bash
run: |
export VERSION=${{ steps.get_version.outputs.VERSION }}
./make.bat pkg-slim
- uses: actions/upload-artifact@v4
with:
name: fibratus-${{ steps.get_version.outputs.VERSION }}-slim-amd64.msi
path: "./build/msi/fibratus-${{ steps.get_version.outputs.VERSION }}-slim-amd64.msi"
release:
runs-on: windows-latest
needs:
- build
- build-slim
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version
id: get_version
shell: bash
run: |
echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c2-)
- uses: actions/download-artifact@v3
with:
name: fibratus-${{ steps.get_version.outputs.VERSION }}-amd64.msi
path: build
- uses: actions/download-artifact@v3
with:
name: fibratus-${{ steps.get_version.outputs.VERSION }}-slim-amd64.msi
path: build
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
prerelease: true
files: |
build/fibratus-${{ steps.get_version.outputs.VERSION }}-amd64.msi
build/fibratus-${{ steps.get_version.outputs.VERSION }}-slim-amd64.msi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}