Skip to content

Commit c7fe0d9

Browse files
authored
Merge pull request #5 from DigiNode-Tools/github-workflow-builds
Updates to build.yml
2 parents 3037867 + f276e9d commit c7fe0d9

2 files changed

Lines changed: 54 additions & 42 deletions

File tree

.github/workflows/build-cpp.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and Release C++ Binaries for ARM64 and x86_64
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-release:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
include:
13+
- architecture: amd64
14+
target: x86_64-linux-gnu
15+
name_suffix: x86_64-linux-gnu
16+
- architecture: arm64
17+
target: aarch64-linux-gnu
18+
name_suffix: aarch64-linux-gnu
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Install Dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
26+
sudo apt-get install -y g++-multilib gcc-multilib
27+
sudo apt-get install -y build-essential libcurl4-openssl-dev libjson-c-dev
28+
29+
- name: Build
30+
run: make ARCH=${{ matrix.architecture }}
31+
env:
32+
CC: ${{ matrix.target }}-gcc
33+
CXX: ${{ matrix.target }}-g++
34+
35+
- name: Prepare .version File
36+
run: |
37+
TAG_NAME=${GITHUB_REF##*/}
38+
VERSION_NUMBER=${TAG_NAME#v}
39+
echo "DGNSM_VER_LOCAL=\"$VERSION_NUMBER\"" > .version
40+
41+
- name: Package Binary and Config Files
42+
run: |
43+
TAG_NAME=${GITHUB_REF##*/}
44+
TAR_NAME=DGNSM-${TAG_NAME}-${{ matrix.name_suffix }}.tar.gz
45+
tar -czvf $TAR_NAME dgnsm .version dgnsm.config.template dgnsm.config.template2
46+
47+
- name: Upload Release Asset
48+
uses: svenstaro/upload-release-action@v2
49+
with:
50+
repo_token: ${{ secrets.GITHUB_TOKEN }}
51+
file: DGNSM-*.tar.gz
52+
tag: ${{ github.ref }}
53+
overwrite: true
54+
file_glob: true

0 commit comments

Comments
 (0)