|
69 | 69 | with:
|
70 | 70 | fetch-depth: 0
|
71 | 71 |
|
| 72 | + - name: Set Env |
| 73 | + uses: Chia-Network/actions/setjobenv@main |
| 74 | + env: |
| 75 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + |
72 | 77 | - name: Checkout mpir for windows
|
73 | 78 | if: matrix.os.matrix == 'windows'
|
74 | 79 | uses: actions/checkout@v4
|
|
90 | 95 | with:
|
91 | 96 | name: c-libraries-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}
|
92 | 97 | path: ./src/lib
|
| 98 | + |
| 99 | + - name: Assemble directory of headers and libraries for distribution |
| 100 | + shell: bash |
| 101 | + run: | |
| 102 | + DIST_DIR="chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}" |
| 103 | + echo "DIST_DIR=$DIST_DIR" >> "$GITHUB_ENV" |
| 104 | + mkdir -p ${DIST_DIR}/static ${DIST_DIR}/shared |
| 105 | +
|
| 106 | + cp src/c_bindings/c_wrapper.h ${DIST_DIR}/ |
| 107 | + find src/lib/static -type f -exec cp {} ${DIST_DIR}/static/ \; |
| 108 | + find src/lib/shared -type f -exec cp {} ${DIST_DIR}/shared/ \; |
| 109 | +
|
| 110 | + - name: Zip (linux/mac) |
| 111 | + if: runner.os != 'Windows' |
| 112 | + run: | |
| 113 | + zip -r chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip ${{ env.DIST_DIR }} |
| 114 | +
|
| 115 | + - name: Zip (windows) |
| 116 | + if: runner.os == 'Windows' |
| 117 | + run: | |
| 118 | + Compress-Archive -Path ${{ env.DIST_DIR }}/* -Destination chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip |
| 119 | +
|
| 120 | + - name: Upload zip as artifact |
| 121 | + uses: actions/upload-artifact@v3 |
| 122 | + with: |
| 123 | + name: chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }} |
| 124 | + path: | |
| 125 | + ${{ github.workspace }}/chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip |
| 126 | +
|
| 127 | + - name: Upload release artifacts |
| 128 | + if: env.RELEASE == 'true' |
| 129 | + env: |
| 130 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 131 | + run: | |
| 132 | + gh release upload \ |
| 133 | + $RELEASE_TAG \ |
| 134 | + chiavdfc-${{ matrix.os.matrix }}-${{ matrix.arch.matrix }}.zip |
| 135 | +
|
| 136 | + - uses: Chia-Network/actions/github/jwt@main |
| 137 | + |
| 138 | + - name: Notify new build |
| 139 | + if: env.RELEASE == 'true' |
| 140 | + run: | |
| 141 | + 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