Skip to content

Commit

Permalink
Merge pull request #355 from skalenetwork/bug/SKALE-4402-fix-automate…
Browse files Browse the repository at this point in the history
…d-signed-build

Bug/skale 4402 fix automated signed build
  • Loading branch information
kladkogex authored Sep 13, 2021
2 parents 2926ad0 + 0a7df56 commit a979cc4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/dockerimagerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ jobs:
shell: bash
- name: Generate public key
run: openssl rsa -in signed_enclaves/skale_sgx_private_key0.pem -pubout -out signed_enclaves/skale_sgx_public_key0.pem
- name: Build enclave
run: ./autoconf.bash && ./configure --with-sgx-build=release && bash -c "make -j$(nproc)"
- name: Sign enclave
run: cd scripts && ./sign_enclave.bash
- name: Delete secrets
run: rm -f signed_enclaves/skale_sgx_private_key0.pem signed_enclaves/skale_sgx_public_key0.pem
- name: Build and deploy docker image
run : |
export BRANCH=${GITHUB_REF##*/}
Expand All @@ -47,6 +41,16 @@ jobs:
bash ./scripts/publish_image.sh sgxwallet_release
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Delete secrets
run: rm -f signed_enclaves/skale_sgx_private_key0.pem signed_enclaves/skale_sgx_public_key0.pem
- name: Copy secure_enclave.signed.so
run: |
export IMAGE_NAME=skalenetwork/sgxwallet_release:$VERSION
docker create --name extract $IMAGE_NAME
docker cp extract:/usr/src/sdk/secure_enclave/secure_enclave.signed.so signed_enclaves/secure_enclave_signed.so
docker rm extract
- name: Check signed enclaves dir
run: ls signed_enclaves
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -63,6 +67,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: signed_enclaves/secure_enclave_signed0.so
asset_path: signed_enclaves/secure_enclave_signed.so
asset_name: signed_enclave.so
asset_content_type: application/octet-stream
6 changes: 5 additions & 1 deletion DockerfileRelease
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ WORKDIR /usr/src/sdk
RUN cp -f secure_enclave/secure_enclave.config.xml.release secure_enclave/secure_enclave.config.xml
RUN apt update && apt install -y curl secure-delete
RUN touch /var/hwmode
RUN ./autoconf.bash
RUN ./configure --with-sgx-build=release
RUN bash -c "make -j$(nproc)"
RUN ccache -sz
RUN cd scripts && ./sign_enclave.bash
RUN mkdir -p /usr/src/sdk/sgx_data
COPY docker/start.sh ./
RUN rm -rf /usr/src/sdk/sgx-sdk-build/
RUN rm /opt/intel/sgxsdk/lib64/*_sim.so
RUN rm /usr/src/sdk/secure_enclave/secure_enclave*.so
RUN cp signed_enclaves/secure_enclave_signed0.so secure_enclabve/secure_enclave.signed.so
RUN cp signed_enclaves/secure_enclave_signed0.so secure_enclave/secure_enclave.signed.so
ENTRYPOINT ["/usr/src/sdk/start.sh"]
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.77.0
1.77.1

0 comments on commit a979cc4

Please sign in to comment.