Skip to content

Commit ddc783e

Browse files
authored
Create WorkFlow.yml
1 parent 857dbed commit ddc783e

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/blank.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Runs when pushing to main branch
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Install dependencies
18+
run: sudo apt update && sudo apt install -y build-essential libssl-dev libboost-all-dev
19+
20+
- name: Compile the project
21+
run: |
22+
make # Build the project
23+
g++ sdhash-src/sdhash.o sdhash-src/sdhash_threads.o libsdbf.a -o JC-sdhash -fopenmp \
24+
-L. -L./external/stage/lib -L/usr/lib/x86_64-linux-gnu \
25+
-lboost_system -lboost_filesystem -lboost_program_options -lc -lm -lcrypto -lboost_thread -lpthread
26+
mv JC-sdhash SDhash # Rename the output binary
27+
ls -lah # List files to verify the build
28+
29+
30+
- name: Create release artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: SDhash-binary
34+
path: ./SDhash # Path to the renamed binary
35+
36+
release:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
- name: Download artifact
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: SDhash-binary
48+
path: .
49+
50+
- name: Create GitHub Release
51+
uses: softprops/action-gh-release@v2
52+
with:
53+
files: ./SDhash # Uploads the renamed binary
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)