Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading