fix: --buildkit-container-name was ignored when --no-buildkit-update … #923
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
name: staging release | |
on: | |
push: | |
branches: | |
- 'main' | |
- '**-staging-test' | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- '.github/renovate.json5' | |
- '.github/CODEOWNERS' | |
- 'LICENSE' | |
jobs: | |
build-earthly: | |
uses: ./.github/workflows/build-earthly.yml | |
with: | |
BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" | |
RUNS_ON: "ubuntu-latest" | |
BINARY: "docker" | |
SUDO: "" | |
secrets: inherit | |
tests: | |
name: staging release | |
needs: build-earthly | |
runs-on: ubuntu-latest | |
env: | |
FORCE_COLOR: 1 | |
EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" | |
EARTHLY_INSTALL_ID: "earthly-githubactions" | |
GITHUB_USER: "earthly" | |
EARTHLY_REPO: "earthly-staging" | |
BREW_REPO: "homebrew-earthly-staging" | |
DOCKERHUB_USER: "earthly" | |
DOCKERHUB_IMG: "earthly-staging" | |
DOCKERHUB_BUILDKIT_IMG: "buildkitd-staging" | |
# Used in our github action as the token - TODO: look to change it into an input | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- name: Configure earthly accounts (Earthly Only) | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | |
run: |- | |
docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" | |
docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" | |
- name: Retrieve earthly from build-earthly job | |
run: |- | |
BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade | |
mkdir -p $(dirname "./build/linux/amd64/earthly") | |
mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/linux/amd64/earthly | |
- name: Configure Earthly to use mirror (Earthly Only) | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | |
run: |- | |
./build/linux/amd64/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] | |
mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" | |
- name: staging releases | |
run: |- | |
set -euo pipefail | |
export SHA_DEC="$(echo "ibase=16; $(git rev-parse --short HEAD | tr '[:lower:]' '[:upper:]')" | bc)" | |
export RELEASE_TAG="v0.$(date +%s).$SHA_DEC" | |
export SKIP_CHANGELOG_DATE_TEST=true | |
export S3_BUCKET="staging-pkg" | |
export earthly="./build/linux/amd64/earthly" | |
echo "attempting staging-release version: $RELEASE_TAG" | |
eval "$(ssh-agent -s)" | |
"$earthly" secrets --org earthly-technologies --project core get -n littleredcorvette-id_rsa | ssh-add - | |
git remote add staging [email protected]:earthly/earthly-staging.git | |
git push staging HEAD:pre-release-$RELEASE_TAG | |
echo -e "# Earthly Changelog\n\nAll notable changes to [Earthly](https://github.com/earthly/earthly) will be documented in this file.\n\n## Unreleased\n\n## $RELEASE_TAG - $(date +%Y-%m-%d)\n\nThis pre-release was built from $(git rev-parse HEAD)" > CHANGELOG.md | |
echo -e "\n### Additional Info\n- This release includes changes to buildkit" >> CHANGELOG.md | |
./release/release.sh | |
- name: Buildkit logs (runs on failure) | |
if: ${{ failure() }} | |
run: docker logs earthly-buildkitd |