From 233efafce1ca26b678a1e83ab86c9953a33ba4b1 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 26 Nov 2024 09:21:04 +1000 Subject: [PATCH] Upload gateway binary to assets and artifacts --- .github/workflows/snapshot-build.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/snapshot-build.yml b/.github/workflows/snapshot-build.yml index dba04fe5b8f..2fbedefe8bd 100644 --- a/.github/workflows/snapshot-build.yml +++ b/.github/workflows/snapshot-build.yml @@ -35,7 +35,7 @@ jobs: upload-executables: true - image: gateway base-artifact: subspace-gateway - upload-executables: false + upload-executables: true - image: bootstrap-node base-artifact: subspace-bootstrap-node upload-executables: false @@ -120,7 +120,7 @@ jobs: docker run --rm --platform linux/arm64 --entrypoint /bin/cat $IMAGE /$ARTIFACT > $ARTIFACT-ubuntu-aarch64-${{ github.ref_name }} if: matrix.build.upload-executables - - name: Upload node and farmer executables to artifacts + - name: Upload node, farmer, and gateway executables to artifacts uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.1.3 with: name: executables-ubuntu-${{ matrix.build.image }}-${{ github.ref_name }} @@ -129,7 +129,7 @@ jobs: if-no-files-found: error if: matrix.build.upload-executables - - name: Upload node and farmer executables to assets + - name: Upload node, farmer, and gateway executables to assets uses: alexellis/upload-assets@13926a61cdb2cb35f5fdef1c06b8b591523236d3 # 0.4.1 env: GITHUB_TOKEN: ${{ github.token }} @@ -245,6 +245,10 @@ jobs: # TODO: We don't configure CUDA for cross-compilation purposes, hence only x86-64 for now if: runner.os == 'Windows' && startsWith(matrix.build.target, 'x86_64') + - name: Build gateway + run: | + cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-gateway + - name: Build node run: | cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-node @@ -262,6 +266,9 @@ jobs: echo "Signing farmer" codesign --force --options=runtime --entitlements .github/workflows/Entitlements.plist -s "${{ secrets.MACOS_IDENTITY }}" --timestamp ${{ env.PRODUCTION_TARGET }}/subspace-farmer + echo "Signing gateway" + codesign --force --options=runtime --entitlements .github/workflows/Entitlements.plist -s "${{ secrets.MACOS_IDENTITY }}" --timestamp ${{ env.PRODUCTION_TARGET }}/subspace-gateway + echo "Signing node" codesign --force --options=runtime --entitlements .github/workflows/Entitlements.plist -s "${{ secrets.MACOS_IDENTITY }}" --timestamp ${{ env.PRODUCTION_TARGET }}/subspace-node @@ -287,6 +294,7 @@ jobs: run: | AzureSignTool sign --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URI }}" --azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" --azure-key-vault-certificate "${{ secrets.AZURE_CERT_NAME }}" --file-digest sha512 --timestamp-rfc3161 http://timestamp.digicert.com -v "${{ env.PRODUCTION_TARGET }}/subspace-farmer.exe" AzureSignTool sign --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URI }}" --azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" --azure-key-vault-certificate "${{ secrets.AZURE_CERT_NAME }}" --file-digest sha512 --timestamp-rfc3161 http://timestamp.digicert.com -v "${{ env.PRODUCTION_TARGET }}/subspace-farmer-rocm.exe" + AzureSignTool sign --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URI }}" --azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" --azure-key-vault-certificate "${{ secrets.AZURE_CERT_NAME }}" --file-digest sha512 --timestamp-rfc3161 http://timestamp.digicert.com -v "${{ env.PRODUCTION_TARGET }}/subspace-gateway.exe" AzureSignTool sign --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URI }}" --azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" --azure-key-vault-certificate "${{ secrets.AZURE_CERT_NAME }}" --file-digest sha512 --timestamp-rfc3161 http://timestamp.digicert.com -v "${{ env.PRODUCTION_TARGET }}/subspace-node.exe" # Allow code signing to fail on non-release builds and in non-subspace repos (forks) continue-on-error: ${{ github.repository_owner != 'autonomys' || github.event_name != 'push' || github.ref_type != 'tag' }} @@ -296,11 +304,14 @@ jobs: run: | mkdir executables mv ${{ env.PRODUCTION_TARGET }}/subspace-farmer executables/subspace-farmer-${{ matrix.build.suffix }} + mv ${{ env.PRODUCTION_TARGET }}/subspace-gateway executables/subspace-gateway-${{ matrix.build.suffix }} mv ${{ env.PRODUCTION_TARGET }}/subspace-node executables/subspace-node-${{ matrix.build.suffix }} # Zip it so that signature is not lost ditto -c -k --rsrc executables/subspace-farmer-${{ matrix.build.suffix }} executables/subspace-farmer-${{ matrix.build.suffix }}.zip + ditto -c -k --rsrc executables/subspace-node-${{ matrix.build.suffix }} executables/subspace-gateway-${{ matrix.build.suffix }}.zip ditto -c -k --rsrc executables/subspace-node-${{ matrix.build.suffix }} executables/subspace-node-${{ matrix.build.suffix }}.zip rm executables/subspace-farmer-${{ matrix.build.suffix }} + rm executables/subspace-gateway-${{ matrix.build.suffix }} rm executables/subspace-node-${{ matrix.build.suffix }} if: runner.os == 'macOS' @@ -309,10 +320,11 @@ jobs: mkdir executables move ${{ env.PRODUCTION_TARGET }}/subspace-farmer.exe executables/subspace-farmer-${{ matrix.build.suffix }}.exe move ${{ env.PRODUCTION_TARGET }}/subspace-farmer-rocm.exe executables/subspace-farmer-rocm-${{ matrix.build.suffix }}.exe + move ${{ env.PRODUCTION_TARGET }}/subspace-node.exe executables/subspace-gateway-${{ matrix.build.suffix }}.exe move ${{ env.PRODUCTION_TARGET }}/subspace-node.exe executables/subspace-node-${{ matrix.build.suffix }}.exe if: runner.os == 'Windows' - - name: Upload node and farmer executables to artifacts + - name: Upload node, farmer, and gateway executables to artifacts uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.1.3 with: name: executables-${{ matrix.build.suffix }} @@ -320,7 +332,7 @@ jobs: executables/* if-no-files-found: error - - name: Upload node and farmer executables to assets + - name: Upload node, farmer, and gateway executables to assets uses: alexellis/upload-assets@13926a61cdb2cb35f5fdef1c06b8b591523236d3 # 0.4.1 env: GITHUB_TOKEN: ${{ github.token }}