-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker build and push - part 1 #56
Merged
Merged
Changes from 144 commits
Commits
Show all changes
160 commits
Select commit
Hold shift + click to select a range
491c51c
merge test 1
magick93 4655e8a
update pr
magick93 855d735
disable jobs
magick93 e5f98f6
Merge pull request #1 from magick93/pr_test_1
magick93 bea39a1
branch check
magick93 4f2dc68
Merge pull request #3 from magick93/pr_test_1
magick93 72409c0
check when merging to stable
magick93 51b7443
attempt to use hcv
magick93 6d6a70f
Merge branch 'Allow-merge-to-stable-when-required-#52' into unstable
magick93 36e937b
tmp comment out
magick93 ca2ff87
Merge pull request #2 from magick93/unstable
magick93 1838ec7
tmp rm CROSS_FEATURES
magick93 d509ae3
Merge pull request #5 from magick93/unstable
magick93 229740b
upgrade
magick93 cde21a8
simplify
magick93 77342f4
Merge pull request #6 from magick93/unstable
magick93 03c689b
use GH_TOKEN
magick93 6080495
Merge pull request #7 from magick93/unstable
magick93 2b98998
hardcode docker repo, set dockerfile location
magick93 fe27047
Merge pull request #8 from magick93/unstable
magick93 cb96e77
use correct dir
magick93 55145ee
Merge pull request #9 from magick93/unstable
magick93 eb2d461
update rust and path
magick93 a97b785
Merge pull request #10 from magick93/unstable
magick93 33f3a57
use Cargo.toml as source of truth
magick93 0fc6e37
Merge pull request #11 from magick93/unstable
magick93 3867484
fix path for toml_reader.sh
magick93 5249158
Merge pull request #12 from magick93/unstable
magick93 e508fa1
debugging
magick93 27b7155
Merge pull request #13 from magick93/unstable
magick93 0890343
corrected path
magick93 145ffae
Merge pull request #14 from magick93/unstable
magick93 ef2e799
debugging
magick93 89d32f9
Merge pull request #15 from magick93/unstable
magick93 35b5db9
use after actions/checkout@v4
magick93 ee9e8ff
Merge pull request #16 from magick93/unstable
magick93 71351c2
re-correcting dir
magick93 294d38d
Merge pull request #17 from magick93/unstable
magick93 5471473
assign rust version to GH_ENV
magick93 49de973
Merge pull request #18 from magick93/unstable
magick93 e8a62a6
remove test docker org
magick93 6909c5b
Merge pull request #19 from magick93/unstable
magick93 195d947
re-enable check-code
magick93 3d83330
rm temp file
magick93 7a0a0c5
Merge pull request #20 from magick93/docker_build_push_part1
magick93 f748823
update futures
magick93 732ed01
tmp workaround for remaining audit error
magick93 cf3a494
Merge pull request #22 from magick93/docker_build_push_part1
magick93 e919c3f
Merge pull request #21 from magick93/unstable
magick93 5e0d751
update hcv path
magick93 c941ab0
Merge pull request #23 from magick93/docker_build_push_part1
magick93 cd202e6
Merge pull request #24 from magick93/unstable
magick93 6a57a37
try another hcv path
magick93 d80a030
Merge pull request #25 from magick93/docker_build_push_part1
magick93 52c370d
Merge pull request #26 from magick93/unstable
magick93 43bd52e
Merge branch 'unstable' into stable
magick93 e615120
Add extract-version workflow and refactor docker workflow to use it
magick93 09fd733
Merge pull request #27 from magick93/reusable_workflows
magick93 6727dc4
Merge pull request #28 from magick93/unstable
magick93 2d98a2d
Refactor Docker workflow to support single and multi-architecture builds
magick93 9533df2
Enhance extract-version workflow to default to 'latest' and add debug…
magick93 ae91231
Refactor Docker workflow to improve architecture support and add debu…
magick93 83fa758
Merge pull request #29 from magick93/releases-from-docker
magick93 135890f
Merge pull request #30 from magick93/unstable
magick93 fee33f8
Refactor Docker workflow to enable multi-architecture builds and stre…
magick93 66ebb3b
Merge pull request #31 from magick93/releases-from-docker
magick93 75be9e3
Merge pull request #32 from magick93/unstable
magick93 bd2240d
rm jemalloc
magick93 11ee356
Merge pull request #33 from magick93/releases-from-docker
magick93 9d0a233
Merge pull request #34 from magick93/unstable
magick93 4c4c454
try with TARGETPLATFORM arg
magick93 8e71ed7
Merge pull request #35 from magick93/releases-from-docker
magick93 1f98a14
Merge pull request #36 from magick93/unstable
magick93 80fe1cd
Update Docker workflow to include architecture-specific tags and enab…
magick93 e773475
Merge pull request #37 from magick93/releases-from-docker
magick93 1cfb88b
Merge pull request #38 from magick93/unstable
magick93 ed1b6f6
disable buildx imagetools, add labels
magick93 0848426
Merge pull request #39 from magick93/releases-from-docker
magick93 61981ff
Merge pull request #40 from magick93/unstable
magick93 d9fec9e
enable md book, only run on sipg org
magick93 c69cbc2
Merge pull request #41 from magick93/releases-from-docker
magick93 b49cda3
Merge pull request #42 from magick93/unstable
magick93 eb7d032
fix yml formatting
magick93 f893bf0
Merge pull request #43 from magick93/releases-from-docker
magick93 d3fe7df
re-Implement linkcheck workflow for mdbook with conditional execution…
magick93 c9c3c56
Merge pull request #44 from magick93/releases-from-docker
magick93 11ba2fd
Add release, debug, and code quality test jobs to Docker workflow
magick93 ec342e5
Merge pull request #45 from magick93/releases-from-docker
magick93 78b9210
Merge pull request #46 from magick93/unstable
magick93 cb2bbcf
remove debugging
magick93 ebc6d86
remove debugging
magick93 5036e06
remove unneeded job
magick93 43685bb
Merge pull request #47 from magick93/releases-from-docker
magick93 bff054b
Merge pull request #48 from magick93/unstable
magick93 584f9f2
remove features
magick93 33abe8f
Merge pull request #49 from magick93/releases-from-docker
magick93 7aebdb9
Merge pull request #50 from magick93/unstable
magick93 6d6c38f
remove x86_64-windows architecture from release workflow due to issue…
magick93 d9b857a
Merge pull request #52 from magick93/releases-from-docker
magick93 9c6c8b2
Merge pull request #53 from magick93/unstable
magick93 69f1ef7
rename build job to support multi-architecture Docker builds
magick93 84525af
disable x86_64-windows architecture in release workflow due to issue #51
magick93 5538e18
Merge pull request #54 from magick93/releases-from-docker
magick93 6b02704
Merge pull request #55 from magick93/unstable
magick93 ef28593
Add mermaid support for our mdbook (#55)
AgeManning 6013c0a
Add conditional check for repository owner in build workflow
magick93 21cb56b
Merge pull request #56 from magick93/book-condition
magick93 067778f
Add job to fail if pull request is a draft
magick93 de905f1
Update pull request trigger types in test suite workflow
magick93 897f4ee
Merge pull request #59 from magick93/test-pr-types
magick93 cc05929
Remove draft pull request failure job from test suite workflow
magick93 00859aa
Merge pull request #60 from magick93/test-pr-types
magick93 b0d67ae
Update Docker workflow to trigger on test suite completion
magick93 ba05463
Merge pull request #61 from magick93/on-tests-pass
magick93 6233bb7
Merge pull request #62 from magick93/unstable
magick93 6682f98
Temporarily disable check-code job in test suite workflow due to depe…
magick93 de4f13c
Remove release, debug, and code quality test jobs from Docker workflow
magick93 f1ad769
Merge pull request #63 from magick93/on-tests-pass
magick93 74461c9
Merge pull request #64 from magick93/unstable
magick93 7252933
rm on workflow_run
magick93 d4aab52
Merge pull request #65 from magick93/on-tests-pass
magick93 dc5ee60
Merge pull request #66 from magick93/unstable
magick93 9a3c481
Fix Docker workflow secret syntax for vault - hopefully
magick93 4994520
Merge pull request #67 from magick93/on-tests-pass
magick93 4731a9c
Merge pull request #68 from magick93/unstable
magick93 07490f1
Re-enable check-code job in test suite workflow
magick93 686ce90
Merge pull request #69 from magick93/on-tests-pass
magick93 39106a9
Merge branch 'unstable' into stable
magick93 b389092
disable jobs
magick93 81ea948
Merge pull request #70 from magick93/unstable
magick93 9b6e5cd
Merge pull request #71 from sigp/unstable
magick93 6b90833
update workflows to use ubuntu-22.04 as the runner environment
magick93 d8497dc
Merge pull request #73 from magick93/ubuntu-latest
magick93 b343219
add cargo update step to test suite workflow
magick93 5801ecf
Merge pull request #74 from magick93/unstable
magick93 0bc18ff
Merge pull request #76 from magick93/update-audit
magick93 25550d2
Merge pull request #77 from magick93/unstable
magick93 8ccf798
enable Windows runner in release workflow
magick93 27387cf
add x86_64-windows architecture back to release workflow
magick93 f8307a6
Merge pull request #78 from magick93/windows-rel
magick93 c892892
Merge pull request #79 from magick93/unstable
magick93 17acbd0
add conditional imports for Unix target family in environment module
magick93 25f2192
Merge pull request #80 from magick93/windows-rel
magick93 5d99284
Merge pull request #81 from magick93/unstable
magick93 dcd6f0c
Add Windows-specific shutdown signal handling
magick93 e55fedd
revert
magick93 7b32477
Add zcross to .gitignore
magick93 e335191
fmt
magick93 8dbb208
Merge branch 'unstable' into windows-shutdown
magick93 7afc4db
Merge branch 'windows-shutdown' into pr-56-review
magick93 303e3db
Merge branch 'stable' into pr-56-review
magick93 dd31f75
Remove RUSTSEC-2024-0399 ignore from cargo audit in Makefile
magick93 9874dd2
Downgrade futures dependency from 0.3.31 to 0.3.30 in Cargo.toml
magick93 84f7de4
Remove cargo update step from test suite workflow
magick93 323915b
Merge pull request #82 from magick93/pr-56-review
magick93 76780ae
Merge pull request #83 from magick93/unstable
magick93 0fcb735
Merge branch 'unstable' into stable
magick93 502e5d5
revert
magick93 f35765e
Merge branch 'unstable' into stable
magick93 a2ee16a
Merge remote-tracking branch 'upstream/unstable' into stable
magick93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# TOML Reader - A script to read values from simple TOML files | ||
# Usage: ./toml_reader.sh <file_path> <section> <key> | ||
|
||
get_section() { | ||
# Function to get the section from a TOML file | ||
# Parameters: | ||
# $1 - TOML file path | ||
# $2 - section name | ||
local file="$1" | ||
local section="$2" | ||
|
||
sed -n "/^\[$section\]/,/^\[/p" "$file" | sed '$d' | ||
} | ||
|
||
get_toml_value() { | ||
# Function to get a value from a TOML file | ||
# Parameters: | ||
# $1 - TOML file path | ||
# $2 - section | ||
# $3 - key | ||
local file="$1" | ||
local section="$2" | ||
local key="$3" | ||
|
||
get_section "$file" "$section" | grep "^$key " | cut -d "=" -f2- | tr -d ' "' | ||
} | ||
|
||
# Show usage if script is called directly | ||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
if [ "$#" -ne 3 ]; then | ||
echo "Error: Incorrect number of arguments" | ||
echo "Usage: $0 <file_path> <section> <key>" | ||
echo "Example: $0 ./config.toml server_b domain" | ||
exit 1 | ||
fi | ||
|
||
# Check if file exists | ||
if [ ! -f "$1" ]; then | ||
echo "Error: File '$1' does not exist" | ||
exit 1 | ||
fi | ||
|
||
# Get the value | ||
result=$(get_toml_value "$1" "$2" "$3") | ||
|
||
# Check if value was found | ||
if [ -z "$result" ]; then | ||
echo "Error: No value found for section '[$2]' and key '$3'" | ||
exit 1 | ||
fi | ||
|
||
echo "$result" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,163 +1,134 @@ | ||
# TODO: Setup docker | ||
# name: docker | ||
# | ||
# on: | ||
# push: | ||
# branches: | ||
# - stable | ||
# tags: | ||
# - v* | ||
# | ||
# concurrency: | ||
# group: ${{ github.workflow }}-${{ github.ref }} | ||
# cancel-in-progress: true | ||
# | ||
# env: | ||
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
# # Enable self-hosted runners for the sigp repo only. | ||
# SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/anchor' }} | ||
# | ||
# jobs: | ||
# # Extract the VERSION which is either `latest` or `vX.Y.Z`, and the VERSION_SUFFIX | ||
# # which is either empty or `-unstable`. | ||
# # | ||
# # It would be nice if the arch didn't get spliced into the version between `latest` and | ||
# # `unstable`, but for now we keep the two parts of the version separate for backwards | ||
# # compatibility. | ||
# extract-version: | ||
# runs-on: ubuntu-22.04 | ||
# steps: | ||
# - name: Extract version (if stable) | ||
# if: github.event.ref == 'refs/heads/stable' | ||
# run: | | ||
# echo "VERSION=latest" >> $GITHUB_ENV | ||
# echo "VERSION_SUFFIX=" >> $GITHUB_ENV | ||
# - name: Extract version (if unstable) | ||
# if: github.event.ref == 'refs/heads/unstable' | ||
# run: | | ||
# echo "VERSION=latest" >> $GITHUB_ENV | ||
# echo "VERSION_SUFFIX=-unstable" >> $GITHUB_ENV | ||
# - name: Extract version (if tagged release) | ||
# if: startsWith(github.event.ref, 'refs/tags') | ||
# run: | | ||
# echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | ||
# echo "VERSION_SUFFIX=" >> $GITHUB_ENV | ||
# outputs: | ||
# VERSION: ${{ env.VERSION }} | ||
# VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }} | ||
# build-docker-single-arch: | ||
# name: build-docker-${{ matrix.binary }}-${{ matrix.cpu_arch }}${{ matrix.features.version_suffix }} | ||
# # Use self-hosted runners only on the sigp repo. | ||
# runs-on: ${{ github.repository == 'sigp/anchor' && fromJson('["self-hosted", "linux", "release"]') || 'ubuntu-22.04' }} | ||
# strategy: | ||
# matrix: | ||
# binary: [anchor] | ||
# cpu_arch: [aarch64, x86_64] | ||
# include: | ||
# - profile: maxperf | ||
# | ||
# needs: [extract-version] | ||
# env: | ||
# VERSION: ${{ needs.extract-version.outputs.VERSION }} | ||
# VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Update Rust | ||
# if: env.SELF_HOSTED_RUNNERS == 'false' | ||
# run: rustup update stable | ||
# - name: Dockerhub login | ||
# run: | | ||
# echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin | ||
# | ||
# - name: Sets env vars for Anchor | ||
# if: startsWith(matrix.binary, 'anchor') | ||
# run: | | ||
# echo "CROSS_FEATURES=gnosis,spec-minimal,slasher-lmdb,jemalloc" >> $GITHUB_ENV | ||
# | ||
# - name: Set `make` command for anchor | ||
# if: startsWith(matrix.binary, 'anchor') | ||
# run: | | ||
# echo "MAKE_CMD=build-${{ matrix.cpu_arch }}" >> $GITHUB_ENV | ||
# | ||
# - name: Set `make` command for lcli | ||
# if: startsWith(matrix.binary, 'lcli') | ||
# run: | | ||
# echo "MAKE_CMD=build-lcli-${{ matrix.cpu_arch }}" >> $GITHUB_ENV | ||
# | ||
# - name: Cross build binaries | ||
# run: | | ||
# cargo install cross | ||
# env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ env.CROSS_FEATURES }} make ${{ env.MAKE_CMD }} | ||
# | ||
# - name: Make bin dir | ||
# run: mkdir ./bin | ||
# | ||
# - name: Move cross-built binary into Docker scope | ||
# run: mv ./target/${{ matrix.cpu_arch }}-unknown-linux-gnu/${{ matrix.profile }}/${{ matrix.binary }} ./bin | ||
# | ||
# - name: Map aarch64 to arm64 short arch | ||
# if: startsWith(matrix.cpu_arch, 'aarch64') | ||
# run: echo "SHORT_ARCH=arm64" >> $GITHUB_ENV | ||
# | ||
# - name: Map x86_64 to amd64 short arch | ||
# if: startsWith(matrix.cpu_arch, 'x86_64') | ||
# run: echo "SHORT_ARCH=amd64" >> $GITHUB_ENV; | ||
# | ||
# - name: Install QEMU | ||
# if: env.SELF_HOSTED_RUNNERS == 'false' | ||
# run: sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
# | ||
# - name: Set up Docker Buildx | ||
# if: env.SELF_HOSTED_RUNNERS == 'false' | ||
# uses: docker/setup-buildx-action@v3 | ||
# | ||
# - name: Build and push (Anchor) | ||
# if: startsWith(matrix.binary, 'anchor') | ||
# uses: docker/build-push-action@v5 | ||
# with: | ||
# file: ./Dockerfile.cross | ||
# context: . | ||
# platforms: linux/${{ env.SHORT_ARCH }} | ||
# push: true | ||
# tags: | | ||
# ${{ github.repository_owner}}/${{ matrix.binary }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }} | ||
# | ||
# - name: Build and push (lcli) | ||
# if: startsWith(matrix.binary, 'lcli') | ||
# uses: docker/build-push-action@v5 | ||
# with: | ||
# file: ./lcli/Dockerfile.cross | ||
# context: . | ||
# platforms: linux/${{ env.SHORT_ARCH }} | ||
# push: true | ||
# | ||
# tags: | | ||
# ${{ github.repository_owner}}/${{ matrix.binary }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }} | ||
# | ||
# | ||
# build-docker-multiarch: | ||
# name: build-docker-${{ matrix.binary }}-multiarch | ||
# runs-on: ubuntu-22.04 | ||
# strategy: | ||
# matrix: | ||
# binary: [anchor, | ||
# lcli] | ||
# needs: [build-docker-single-arch, extract-version] | ||
# env: | ||
# VERSION: ${{ needs.extract-version.outputs.VERSION }} | ||
# VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }} | ||
# steps: | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v3 | ||
# | ||
# - name: Dockerhub login | ||
# run: | | ||
# echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin | ||
# | ||
# - name: Create and push multiarch manifests | ||
# run: | | ||
# docker buildx imagetools create -t ${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}${VERSION_SUFFIX} \ | ||
# ${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-arm64${VERSION_SUFFIX} \ | ||
# ${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-amd64${VERSION_SUFFIX}; | ||
# | ||
name: Docker build and push | ||
|
||
on: | ||
push: | ||
branches: | ||
- stable | ||
tags: | ||
- v* | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Enable self-hosted runners for the sigp repo only. | ||
SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/anchor' }} | ||
RUST_VERSION: '1.80.0' | ||
SHORT_ARCH: 'amd64' | ||
# Deny warnings in CI | ||
RUSTFLAGS: "-D warnings -C debuginfo=0" | ||
# Prevent Github API rate limiting | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
extract-version: | ||
uses: ./.github/workflows/extract-version.yml | ||
|
||
|
||
build-docker-multi-arch: | ||
name: build-docker-anchor-${{ matrix.cpu_arch }} | ||
runs-on: ${{ github.repository == 'sigp/anchor' && fromJson('["self-hosted", "linux", "release"]') || 'ubuntu-22.04' }} | ||
strategy: | ||
matrix: | ||
cpu_arch: [aarch64, x86_64] | ||
include: | ||
- profile: maxperf | ||
|
||
needs: [extract-version] | ||
env: | ||
VERSION: ${{ needs.extract-version.outputs.VERSION }} | ||
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }} | ||
steps: | ||
|
||
- name: Map aarch64 to arm64 short arch | ||
if: startsWith(matrix.cpu_arch, 'aarch64') | ||
run: echo "SHORT_ARCH=arm64" >> $GITHUB_ENV | ||
|
||
- name: Map x86_64 to amd64 short arch | ||
if: startsWith(matrix.cpu_arch, 'x86_64') | ||
run: echo "SHORT_ARCH=amd64" >> $GITHUB_ENV | ||
|
||
|
||
- name: Install Rust and Cargo | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
source $HOME/.cargo/env | ||
echo "PATH=$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV | ||
|
||
|
||
- name: cargo install cross | ||
run: | | ||
cargo install cross | ||
|
||
# - uses: actions/checkout@v4 | ||
# - name: Update Rust | ||
# if: env.SELF_HOSTED_RUNNERS == 'false' | ||
# run: rustup update stable | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get rust-version | ||
id: get-rust-version | ||
run: | | ||
echo "RUST_VERSION=$(./.github/scripts/toml_reader.sh ./anchor/Cargo.toml package rust-version)" >> $GITHUB_ENV | ||
|
||
- name: Get latest version of stable Rust | ||
run: echo "rust version is ${{ env.RUST_VERSION }}" | ||
|
||
- name: Retrieve Docker credentials from Vault | ||
uses: hashicorp/vault-action@v2 | ||
with: | ||
url: https://vault.sigp.io | ||
method: github | ||
githubToken: ${{ secrets.GH_TOKEN }} | ||
secrets: | | ||
spesi_kv/data/dev/docker/anchor DOCKER_USERNAME ; | ||
spesi_kv/data/dev/docker/anchor DOCKER_PASSWORD | ||
|
||
- name: Dockerhub login | ||
run: | | ||
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin | ||
|
||
- name: Build binary | ||
run: | | ||
cargo install cross | ||
env CROSS_PROFILE=${{ matrix.profile }} make build-${{ matrix.cpu_arch }} | ||
|
||
|
||
- name: Set `make` command for anchor | ||
run: | | ||
echo "MAKE_CMD=build-${{ matrix.cpu_arch }}" >> $GITHUB_ENV | ||
|
||
- name: Make bin dir | ||
run: mkdir ./bin | ||
|
||
- name: Move built binary into Docker scope | ||
run: mv ./target/${{ matrix.cpu_arch }}-unknown-linux-gnu/${{ matrix.profile }}/anchor ./bin | ||
|
||
- name: Install QEMU | ||
if: env.SELF_HOSTED_RUNNERS == 'false' | ||
run: sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
|
||
- name: Set up Docker Buildx | ||
if: env.SELF_HOSTED_RUNNERS == 'false' | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ./anchor/Dockerfile.cross | ||
context: . | ||
platforms: linux/${{ env.SHORT_ARCH }} | ||
labels: | | ||
git.revision=${{ github.sha }} | ||
git.branch=${{ github.ref }} | ||
git.tag=${{ github.ref }} | ||
git.repository=${{ github.repository }} | ||
push: true | ||
tags: | | ||
${{ github.repository_owner}}/anchor:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }} | ||
build-args: | | ||
RUST_VERSION=${{ env.RUST_VERSION }} | ||
TARGETPLATFORM=linux/${{ env.SHORT_ARCH }} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these have changed. They are now
DH_ORG
andDH_KEY
I thinkThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In these workflows we are not trusting github to responsibility protect the dockerhub token in perpetuity. Instead we give it on demand, and approval, via vault.
While it does use
DOCKER_USERNAME
andDOCKER_PASSWORD
vars internally, the only variable that needs to be set in Github is to add your org token. See https://www.notion.so/sigp/HashiCorp-Vault-12a56eefb55e8023bb58de9d57cfe2b8