From 81ebb4ecc4d5621f84cd3c38fe1c45f8c4df5e0d Mon Sep 17 00:00:00 2001 From: rabbitstack Date: Wed, 15 Jan 2025 18:38:51 +0100 Subject: [PATCH 1/2] fix(build): Fail if compilation doesn't succeed --- make.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make.bat b/make.bat index a2cc24ae8..6f2dd7653 100644 --- a/make.bat +++ b/make.bat @@ -54,6 +54,7 @@ if "%~1"=="mc" goto mc :build :: set PKG_CONFIG_PATH=pkg-config go build -ldflags %LDFLAGS% -tags %TAGS% -o .\cmd\fibratus\fibratus.exe .\cmd\fibratus +if errorlevel 1 goto fail go build -ldflags %LDFLAGS% -o .\cmd\systray\fibratus-systray.exe .\cmd\systray if errorlevel 1 goto fail goto :EOF @@ -79,6 +80,7 @@ goto :EOF :rsrc set RC_VER=%VERSION:.=,% windres --define RC_VER=%RC_VER% --define VER=%VERSION% -i cmd\fibratus\fibratus.rc -O coff -o cmd\fibratus\fibratus.syso +if errorlevel 1 goto fail windres --define RC_VER=%RC_VER% --define VER=%VERSION% -i cmd\systray\fibratus-systray.rc -O coff -o cmd\systray\fibratus-systray.syso if errorlevel 1 goto fail goto :EOF From f2fdc4d009fadcf3c0d2b5cc7007e1b7d3739c8e Mon Sep 17 00:00:00 2001 From: rabbitstack Date: Wed, 15 Jan 2025 19:01:23 +0100 Subject: [PATCH 2/2] fix(ci): Set up Python via action Python 3.7.x was removed from the Windows Server 2022 image, so we have to set it up manually. --- .github/workflows/master.yml | 41 +++++++++++++++++++++++------------ .github/workflows/pr.yml | 35 ++++++++++++++++++++---------- .github/workflows/release.yml | 17 ++++++++++----- 3 files changed, 62 insertions(+), 31 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 14cff67e6..e2a4dbd41 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -12,17 +12,22 @@ on: env: GO_VERSION: 1.23.x WIX_VERSION: 5.0.0 + PYTHON_VERSION: 3.7.9 jobs: build: runs-on: windows-latest steps: + - name: Checkout + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout - uses: actions/checkout@v4 + go-version: ${{ env.GO_VERSION }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - name: Adjust pkg-config prefix shell: bash run: | @@ -101,12 +106,12 @@ jobs: build-slim: runs-on: windows-latest steps: + - name: Checkout + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout - uses: actions/checkout@v4 + go-version: ${{ env.GO_VERSION }} - name: Build shell: bash run: | @@ -126,14 +131,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - 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: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - name: Setup msys2 uses: msys2/setup-msys2@v2 with: @@ -176,14 +185,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - 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: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - name: Setup msys2 uses: msys2/setup-msys2@v2 with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3abd827b4..0f52990ea 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,6 +10,7 @@ on: env: GO_VERSION: 1.23.x WIX_VERSION: 5.0.0 + PYTHON_VERSION: 3.7.9 jobs: build: @@ -19,12 +20,16 @@ jobs: uses: amannn/action-semantic-pull-request@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout - uses: actions/checkout@v4 + go-version: ${{ env.GO_VERSION }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - name: Adjust pkg-config prefix shell: bash run: | @@ -108,14 +113,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - 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: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - name: Setup msys2 uses: msys2/setup-msys2@v2 with: @@ -158,14 +167,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - 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: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - name: Setup msys2 uses: msys2/setup-msys2@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6225ad6e..43944be4d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,17 +8,22 @@ on: env: GO_VERSION: 1.23.x WIX_VERSION: 5.0.0 + PYTHON_VERSION: 3.7.9 jobs: build: runs-on: windows-latest steps: + - name: Checkout + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout - uses: actions/checkout@v4 + go-version: ${{ env.GO_VERSION }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - name: Adjust pkg-config prefix shell: bash run: | @@ -115,12 +120,12 @@ jobs: build-slim: runs-on: windows-latest steps: + - name: Checkout + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout - uses: actions/checkout@v4 + go-version: ${{ env.GO_VERSION }} - name: Get version id: get_version shell: bash