diff --git a/.github/actions/dockerfiles/Dockerfile.alpine-binary b/.github/actions/dockerfiles/Dockerfile.alpine-binary index 61151f0d2a..eae3a123bf 100644 --- a/.github/actions/dockerfiles/Dockerfile.alpine-binary +++ b/.github/actions/dockerfiles/Dockerfile.alpine-binary @@ -7,14 +7,18 @@ ARG TARGETPLATFORM ARG BUILDPLATFORM ARG TARGETARCH ARG TARGETVARIANT -ARG REPO=stacks-network/stacks-core +ARG REPO -RUN case ${TARGETARCH} in \ - "amd64") BIN_ARCH=linux-musl-x64-v3 ;; \ - "arm64") BIN_ARCH=linux-musl-arm64 ;; \ - "arm") BIN_ARCH=linux-musl-armv7 ;; \ - "*") exit 1 ;; \ +RUN case ${TARGETPLATFORM} in \ + linux/amd64/v2) BIN_ARCH=linux-glibc-x64-v2 ;; \ + linux/amd64*) BIN_ARCH=linux-glibc-x64 ;; \ + linux/arm64*) BIN_ARCH=linux-glibc-arm64 ;; \ + linux/arm/v7) BIN_ARCH=linux-glibc-armv7 ;; \ + *) exit 1 ;; \ esac \ + && echo "TARGETPLATFORM: $TARGETPLATFORM" \ + && echo "BIN_ARCH: $BIN_ARCH" \ + && echo "wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip" \ && wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip \ && unzip ${BIN_ARCH}.zip -d /out diff --git a/.github/actions/dockerfiles/Dockerfile.debian-binary b/.github/actions/dockerfiles/Dockerfile.debian-binary index 7bfd252c04..f446190853 100644 --- a/.github/actions/dockerfiles/Dockerfile.debian-binary +++ b/.github/actions/dockerfiles/Dockerfile.debian-binary @@ -7,14 +7,18 @@ ARG TARGETPLATFORM ARG BUILDPLATFORM ARG TARGETARCH ARG TARGETVARIANT -ARG REPO=stacks-network/stacks-core +ARG REPO -RUN case ${TARGETARCH} in \ - "amd64") BIN_ARCH=linux-glibc-x64-v3 ;; \ - "arm64") BIN_ARCH=linux-glibc-arm64 ;; \ - "arm") BIN_ARCH=linux-glibc-armv7 ;; \ - "*") exit 1 ;; \ +RUN case ${TARGETPLATFORM} in \ + linux/amd64/v2) BIN_ARCH=linux-glibc-x64-v2 ;; \ + linux/amd64*) BIN_ARCH=linux-glibc-x64 ;; \ + linux/arm64*) BIN_ARCH=linux-glibc-arm64 ;; \ + linux/arm/v7) BIN_ARCH=linux-glibc-armv7 ;; \ + *) exit 1 ;; \ esac \ + && echo "TARGETPLATFORM: $TARGETPLATFORM" \ + && echo "BIN_ARCH: $BIN_ARCH" \ + && echo "wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip" \ && wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip \ && unzip ${BIN_ARCH}.zip -d /out diff --git a/.github/workflows/create-source-binary.yml b/.github/workflows/create-source-binary.yml index d0cff1cde6..0848cf2eb4 100644 --- a/.github/workflows/create-source-binary.yml +++ b/.github/workflows/create-source-binary.yml @@ -40,8 +40,10 @@ jobs: cpu: - arm64 - armv7 - - x86-64 - - x86-64-v3 + - x86-64 ## defaults to x86-64-v3 variant - intel haswell (2013) and newer + # - x86-64-v2 ## intel nehalem (2008) and newer + # - x86-64-v3 ## intel haswell (2013) and newer + # - x86-64-v4 ## intel skylake (2017) and newer exclude: - arch: windows # excludes windows-arm64 cpu: arm64 @@ -57,19 +59,33 @@ jobs: uses: stacks-network/actions/docker@main - name: Set Local env vars - id: set_envars + id: set_env run: | case ${{ matrix.cpu }} in x86-64) - TARGET_CPU="${{ matrix.cpu }}" + ## default x64 builds to use v3 variant. TARGET_CPU is required to build for v3 via RUSTFLAGS + TARGET_CPU="${{ matrix.cpu }}-v3" DOCKERFILE_CPU="x64" ARCHIVE_NAME="x64" ;; + x86-64-v2) + ## intel nehalem (2008) and newer + TARGET_CPU="${{ matrix.cpu }}" + DOCKERFILE_CPU="x64" + ARCHIVE_NAME="x64-v2" + ;; x86-64-v3) + ## intel haswell (2013) and newer TARGET_CPU="${{ matrix.cpu }}" DOCKERFILE_CPU="x64" ARCHIVE_NAME="x64-v3" ;; + x86-64-v4) + ## intel skylake (2017) and newer + TARGET_CPU="${{ matrix.cpu }}" + DOCKERFILE_CPU="x64" + ARCHIVE_NAME="x64-v4" + ;; *) TARGET_CPU="" DOCKERFILE_CPU="${{ matrix.cpu }}" @@ -79,9 +95,6 @@ jobs: echo "DOCKERFILE=Dockerfile.${{ matrix.arch }}-${DOCKERFILE_CPU}" >> "$GITHUB_ENV" echo "ZIPFILE=${{ matrix.arch }}-${ARCHIVE_NAME}" >> "$GITHUB_ENV" echo "TARGET_CPU=${TARGET_CPU}" >> "$GITHUB_ENV" - echo "DOCKERFILE: ${DOCKERFILE}" - echo "ZIPFILE: ${ZIPFILE}" - echo "TARGET_CPU: ${TARGET_CPU}" ## Build the binaries using defined dockerfiles - name: Build Binary (${{ matrix.arch }}_${{ matrix.cpu }}) diff --git a/.github/workflows/image-build-binary.yml b/.github/workflows/image-build-binary.yml index 11a1012188..b804ae3be6 100644 --- a/.github/workflows/image-build-binary.yml +++ b/.github/workflows/image-build-binary.yml @@ -12,7 +12,7 @@ on: ## Define which docker arch to build for env: - docker_platforms: "linux/arm64, linux/arm/v7, linux/amd64, linux/amd64/v2, linux/amd64/v3" + docker_platforms: "linux/arm64, linux/arm/v7, linux/amd64, linux/amd64/v3" docker-org: blockstack concurrency: @@ -52,7 +52,7 @@ jobs: ## if the repo owner is not `stacks-network`, default to a docker-org of the repo owner (i.e. github user id) ## this allows forks to run the docker push workflows without having to hardcode a dockerhub org (but it does require docker hub user to match github username) - name: Set Local env vars - id: set_envars + id: set_env if: | github.repository_owner != 'stacks-network' run: | @@ -65,6 +65,7 @@ jobs: id: docker_metadata uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 #v5.0.0 with: + ## tag images with current repo name `stacks-core` as well as legacy `stacks-blockchain` images: | ${{env.docker-org}}/${{ github.event.repository.name }} ${{env.docker-org}}/stacks-blockchain diff --git a/.github/workflows/image-build-source.yml b/.github/workflows/image-build-source.yml index c2609caf37..ebb9afc679 100644 --- a/.github/workflows/image-build-source.yml +++ b/.github/workflows/image-build-source.yml @@ -8,7 +8,7 @@ on: ## Define which docker arch to build for env: - docker_platforms: linux/amd64 + docker_platforms: "linux/amd64" docker-org: blockstack concurrency: @@ -40,7 +40,7 @@ jobs: ## if the repo owner is not `stacks-network`, default to a docker-org of the repo owner (i.e. github user id) ## this allows forks to run the docker push workflows without having to hardcode a dockerhub org (but it does require docker hub user to match github username) - name: Set Local env vars - id: set_envars + id: set_env if: | github.repository_owner != 'stacks-network' run: | @@ -68,7 +68,6 @@ jobs: tags: ${{ steps.docker_metadata.outputs.tags }} labels: ${{ steps.docker_metadata.outputs.labels }} build-args: | - REPO=${{ github.repository_owner }}/${{ github.event.repository.name }} STACKS_NODE_VERSION=${{ env.GITHUB_SHA_SHORT }} GIT_BRANCH=${{ env.GITHUB_REF_SHORT }} GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }}