Skip to content

Commit c62f396

Browse files
committed
Build a zip with the .h and libraries + upload to release on release
1 parent 2e9bc3e commit c62f396

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/build-c-libraries.yml

+39
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ jobs:
6969
with:
7070
fetch-depth: 0
7171

72+
- name: Set Env
73+
uses: Chia-Network/actions/setjobenv@main
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
7277
- name: Checkout mpir for windows
7378
if: matrix.os.matrix == 'windows'
7479
uses: actions/checkout@v4
@@ -90,3 +95,37 @@ jobs:
9095
with:
9196
name: c-libraries-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}
9297
path: ./src/lib
98+
99+
- name: Assemble zip of headers and libraries
100+
shell: bash
101+
run: |
102+
mkdir -p dist/static dist/shared
103+
104+
cp src/c_bindings/c_wrapper.h dist/
105+
find src/lib/static -type f -exec cp {} dist/static/ \;
106+
find src/lib/shared -type f -exec cp {} dist/shared/ \;
107+
108+
zip -r chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip dist
109+
110+
- name: Upload zip as artifact
111+
uses: actions/upload-artifact@v3
112+
with:
113+
name: chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}
114+
path: |
115+
${{ github.workspace }}/chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip
116+
117+
- name: Upload release artifacts
118+
if: env.RELEASE == 'true'
119+
env:
120+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
run: |
122+
gh release upload \
123+
$RELEASE_TAG \
124+
chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip
125+
126+
- uses: Chia-Network/actions/github/jwt@main
127+
128+
- name: Notify new build
129+
if: env.RELEASE == 'true'
130+
run: |
131+
curl -s -XPOST -H "Authorization: Bearer ${{ env.JWT_TOKEN }}" --data '{"release_version":"${{ env.RELEASE_TAG }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/chiavdfc/trigger

0 commit comments

Comments
 (0)