Skip to content
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

Fix docker build on BuildKit (now the default on Actions runners) #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
run: |
echo $GITHUB_TOKEN | docker login ghcr.io -u SteamDeckHomebrew --password-stdin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download SteamOS
run: ./download.sh
id: download
run: ./download.sh >>$GITHUB_OUTPUT

- name: Build base image
run: sudo ./build.sh
- name: Build and tag base image
run: |
sudo ./build.sh

- name: Cleanup SteamOS image
run: rm -rf ./steamos_image ./steamos
Expand All @@ -42,19 +44,32 @@ jobs:
cd languages
docker build -t ghcr.io/steamdeckhomebrew/holo-toolchain-go:latest -f ./go.dockerfile .

- name: Tag all images
run: |
for tag in \
"${{ steps.download.outputs.BUILD_ID }}" \
"${{ steps.download.outputs.FULL_VERSION }}" \
"${{ steps.download.outputs.MAJOR_VERSION }}" \
"${{ steps.download.outputs.MINOR_VERSION }}"
do
docker tag ghcr.io/steamdeckhomebrew/holo-base:latest ghcr.io/steamdeckhomebrew/holo-base:$tag
docker tag ghcr.io/steamdeckhomebrew/holo-toolchain-rust:latest ghcr.io/steamdeckhomebrew/holo-toolchain-rust:$tag
docker tag ghcr.io/steamdeckhomebrew/holo-toolchain-go:latest ghcr.io/steamdeckhomebrew/holo-toolchain-go:$tag
done

- name: Wait for other runs to complete
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push Base image
run: docker push ghcr.io/steamdeckhomebrew/holo-base:latest
run: docker push --all-tags ghcr.io/steamdeckhomebrew/holo-base

- name: Push Rust toolchain image
run: docker push ghcr.io/steamdeckhomebrew/holo-toolchain-rust:latest
run: docker push --all-tags ghcr.io/steamdeckhomebrew/holo-toolchain-rust

- name: Push Go toolchain image
run: docker push ghcr.io/steamdeckhomebrew/holo-toolchain-go:latest
run: docker push --all-tags ghcr.io/steamdeckhomebrew/holo-toolchain-go:latest

- name: Log out of GitHub Container Registry
run: |
Expand Down
21 changes: 16 additions & 5 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ set -e

# these are hardcoded and can be found in ~/.netrc
AUTH="jupiter-image-2021:e54fe7f0-756e-46e1-90d2-7843cda0ac01"
FILE=$(curl -sS --user $AUTH "https://steamdeck-atomupd.steamos.cloud/updates?product=steamos&release=holo&variant=steamdeck&arch=amd64&version=snapshot&buildid=20220526.1&checkpoint=False&estimated_size=0" | jq -r ".minor.candidates[0].update_path" | sed 's/\.raucb/\.img.zip/')
echo "Downloading image $FILE"
curl --user $AUTH "https://steamdeck-images.steamos.cloud/$FILE" -o ./steamos.zip
unzip ./steamos.zip -d ./steamos_image
rm ./steamos.zip
IMAGE="$(curl -sS --user $AUTH "https://steamdeck-atomupd.steamos.cloud/updates?product=steamos&release=holo&variant=steamdeck&arch=amd64&version=snapshot&buildid=20220526.1&checkpoint=False&estimated_size=0" | jq -r '.minor.candidates[0]')"
FILE=$(echo "$IMAGE" | jq -r ".update_path" | sed 's/\.raucb/\.img.zip/')

{
echo "Downloading image $FILE"
curl --user $AUTH "https://steamdeck-images.steamos.cloud/$FILE" -o ./steamos.zip
unzip ./steamos.zip -d ./steamos_image
rm ./steamos.zip
} >&2

# Output the downloaded version for github actions to tag the images
echo "BUILD_ID=$(echo "$IMAGE" | jq -r '.image.buildid')"
FULL_VERSION="$(echo "$IMAGE" | jq -r '.image.version')"
echo "FULL_VERSION=${FULL_VERSION}"
echo "MAJOR_VERSION=$(echo "$FULL_VERSION" | cut -d. -f 1)"
echo "MINOR_VERSION=$(echo "$FULL_VERSION" | cut -d. -f 1,2)"