Skip to content

Commit

Permalink
Build a zip with the .h and libraries + upload to release on release (#…
Browse files Browse the repository at this point in the history
…168)

* Build a zip with the .h and libraries + upload to release on release

* Windows zip is naturally different

* rename dist to the actual zip name, so when unzipped it also has that name

* Pass dist dir to subsequent steps

* Fix missed dist dir
  • Loading branch information
cmmarslender authored Mar 8, 2024
1 parent 2e9bc3e commit 70c1f96
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-c-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ jobs:
with:
fetch-depth: 0

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout mpir for windows
if: matrix.os.matrix == 'windows'
uses: actions/checkout@v4
Expand All @@ -90,3 +95,47 @@ jobs:
with:
name: c-libraries-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}
path: ./src/lib

- name: Assemble directory of headers and libraries for distribution
shell: bash
run: |
DIST_DIR="chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}"
echo "DIST_DIR=$DIST_DIR" >> "$GITHUB_ENV"
mkdir -p ${DIST_DIR}/static ${DIST_DIR}/shared
cp src/c_bindings/c_wrapper.h ${DIST_DIR}/
find src/lib/static -type f -exec cp {} ${DIST_DIR}/static/ \;
find src/lib/shared -type f -exec cp {} ${DIST_DIR}/shared/ \;
- name: Zip (linux/mac)
if: runner.os != 'Windows'
run: |
zip -r chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip ${{ env.DIST_DIR }}
- name: Zip (windows)
if: runner.os == 'Windows'
run: |
Compress-Archive -Path ${{ env.DIST_DIR }}/* -Destination chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip
- name: Upload zip as artifact
uses: actions/upload-artifact@v3
with:
name: chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}
path: |
${{ github.workspace }}/chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip
- name: Upload release artifacts
if: env.RELEASE == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload \
$RELEASE_TAG \
chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip
- uses: Chia-Network/actions/github/jwt@main

- name: Notify new build
if: env.RELEASE == 'true'
run: |
curl -s -XPOST -H "Authorization: Bearer ${{ env.JWT_TOKEN }}" --data '{"release_version":"${{ env.RELEASE_TAG }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/chiavdfc/trigger

0 comments on commit 70c1f96

Please sign in to comment.