Skip to content

js-soroban-client local file path installation (#74) #276

js-soroban-client local file path installation (#74)

js-soroban-client local file path installation (#74) #276

Workflow file for this run

name: Dockerfile
on:
push:
branches:
- master
tags:
- '*'
pull_request:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
# the only time system test image needs to be defined for a push is when it's a non 'v' tag creation
PUSH_ENABLED: ${{ secrets.DOCKERHUB_TOKEN && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') != true && 'true' || 'false' }}
IMAGE: ${{ format('{0}/{1}:{2}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository, github.event.ref || 'latest') }}
CORE_GIT_REF: https://github.com/stellar/stellar-core.git#master
CORE_COMPILE_CONFIGURE_FLAGS: "--disable-tests --enable-next-protocol-version-unsafe-for-production"
SOROBAN_RPC_GIT_REF: https://github.com/stellar/soroban-tools.git#main
RUST_TOOLCHAIN_VERSION: stable
SOROBAN_CLI_GIT_REF: https://github.com/stellar/soroban-tools.git#main
QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#master
jobs:
complete:
if: always()
needs: [build]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
build:
runs-on: ubuntu-latest-16-cores
outputs:
push_enabled: ${{ env.PUSH_ENABLED }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_SHA }}
- name: Build System Test Image
run: |
make CORE_GIT_REF=${{ env.CORE_GIT_REF }} \
CORE_COMPILE_CONFIGURE_FLAGS="${{ env.CORE_COMPILE_CONFIGURE_FLAGS }}" \
SOROBAN_RPC_GIT_REF=${{ env.SOROBAN_RPC_GIT_REF }} \
RUST_TOOLCHAIN_VERSION=${{ env.RUST_TOOLCHAIN_VERSION }} \
SOROBAN_CLI_GIT_REF=${{ env.SOROBAN_CLI_GIT_REF }} \
SYSTEM_TEST_IMAGE=${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} \
QUICKSTART_GIT_REF=${{ env.QUICKSTART_GIT_REF }} build;
- if: ${{ env.PUSH_ENABLED == 'true' }}
name: Save Docker Image to file
run: |
docker save ${{ env.IMAGE }} -o /tmp/image;
- if: ${{ env.PUSH_ENABLED == 'true' }}
name: Upload System Test Image
uses: actions/upload-artifact@v2
with:
name: image-Dockerfile
path: /tmp/image
push:
# Only push non 'vX.Y.Z' tags as pre-built system test image with versions compiled into image.
# pr's and releases don't need to be pushed as docker images, because system test is meant to be built
# from source locally.
needs: build
permissions:
packages: write
statuses: write
runs-on: ubuntu-latest
if: needs.build.outputs.push_enabled == 'true'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_SHA }}
- id: push
uses: ./.github/actions/push
with:
head_sha: ${{ env.HEAD_SHA }}
artifact_name: image-Dockerfile
artifact_image_file: image
image: ${{ env.IMAGE }}
registry: ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }}
username: ${{ secrets.DOCKERHUB_USERNAME || github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN || github.token }}