Skip to content

Commit 8784f77

Browse files
authored
Merge pull request #110 from wipedlifepotato/master
workflows
2 parents 2583ba8 + 066eb98 commit 8784f77

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

.github/workflows/build.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build and Cross-compile
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest]
16+
compiler: [clang]
17+
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v3
22+
with:
23+
submodules: true
24+
25+
#######################
26+
# Ubuntu dependencies #
27+
#######################
28+
- name: Install dependencies (Ubuntu)
29+
if: matrix.os == 'ubuntu-latest'
30+
run: |
31+
sudo apt update
32+
sudo apt install --no-install-recommends -y build-essential libboost-all-dev libssl-dev git
33+
34+
- name: Cache build artifacts (Ubuntu)
35+
if: matrix.os == 'ubuntu-latest'
36+
uses: actions/cache@v3
37+
with:
38+
path: |
39+
obj
40+
libi2pd.a
41+
key: ubuntu-build-${{ runner.os }}-${{ hashFiles('**/*.cpp', '**/*.h') }}
42+
43+
- name: Install MSYS2 (Windows)
44+
if: matrix.os == 'windows-latest'
45+
run: |
46+
Invoke-WebRequest -Uri "https://github.com/msys2/msys2-installer/releases/download/2025-08-30/msys2-x86_64-20250830.exe" -OutFile "msys2-installer.exe"
47+
Start-Process -Wait -FilePath "msys2-installer.exe" -ArgumentList "/S"
48+
C:\msys64\usr\bin\bash.exe -lc "pacman -Syu --noconfirm"
49+
C:\msys64\usr\bin\bash.exe -lc "export ARCH=x86_64; export MINGW=mingw64; pacman -S --noconfirm mingw-w64-$ARCH-gcc mingw-w64-$ARCH-boost mingw-w64-$ARCH-openssl git make"
50+
51+
- name: Initialize Git Submodules
52+
run: git submodule update --init --recursive
53+
54+
- name: Build Project (Ubuntu)
55+
if: matrix.os == 'ubuntu-latest'
56+
run: |
57+
make -j8
58+
make stripall
59+
make builddir
60+
61+
- name: Build Project (Windows)
62+
if: matrix.os == 'windows-latest'
63+
run: |
64+
C:\msys64\usr\bin\bash.exe -lc "cd /c/runner/work/i2pd-tools/i2pd-tools && make && make stripall && make builddir"
65+
66+
- name: Upload binaries
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: my-binaries-${{ matrix.os }}
70+
path: build/*
71+

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ clean-obj:
107107
rm -f $(wildcard *.o)
108108
stripall:
109109
strip b33address famtool i2pbase64 keygen keyinfo offlinekeys regaddr regaddr_3ld regaddralias routerinfo x25519 verifyhost vain autoconf
110-
110+
builddir:
111+
mkdir -p build
112+
mv b33address famtool i2pbase64 keygen keyinfo offlinekeys regaddr regaddr_3ld regaddralias routerinfo x25519 verifyhost vain autoconf build/ || true
111113
clean-bin:
112114
rm -f b33address famtool i2pbase64 keygen keyinfo offlinekeys regaddr regaddr_3ld regaddralias routerinfo x25519 verifyhost vain autoconf
113115

0 commit comments

Comments
 (0)