Skip to content

Commit

Permalink
Tag version, patch version and build ID
Browse files Browse the repository at this point in the history
Since all this is already available in the image, all we have to do is
extract it for the actions to use.
  • Loading branch information
ian-h-chamberlain committed Sep 21, 2023
1 parent c79e43f commit 7bbdd30
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ 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
Expand All @@ -29,6 +29,12 @@ jobs:
- name: Build base image
run: sudo ./build.sh

- name: Get base image version info
id: version
run: |
docker run ghcr.io/steamdeckhomebrew/holo-base:latest \
cat /etc/os-release >> $GITHUB_OUTPUT
- name: Cleanup SteamOS image
run: rm -rf ./steamos_image ./steamos

Expand All @@ -47,14 +53,23 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push Base image
run: docker push ghcr.io/steamdeckhomebrew/holo-base:latest
- name: Tag and push images
run: |
VERSION_FULL=${{ steps.version.outputs.VERSION_ID }}
VERSION_MINOR=$(echo $VERSION_FULL | cut -d. -f1,2)
BUILD_ID=${{ steps.version.outputs.BUILD_ID }}
for IMAGE in \
base toolchain-rust toolchain-go
do
IMG_ID=$(docker images -q ghcr.io/steamdeckhomebrew/holo-$IMAGE:latest)
- name: Push Rust toolchain image
run: docker push ghcr.io/steamdeckhomebrew/holo-toolchain-rust:latest
docker tag $IMG_ID ghcr.io/steamdeckhomebrew/holo-$IMAGE:$VERSION_FULL
docker tag $IMG_ID ghcr.io/steamdeckhomebrew/holo-$IMAGE:$VERSION_MINOR
docker tag $IMG_ID ghcr.io/steamdeckhomebrew/holo-$IMAGE:build-$BUILD_ID
- name: Push Go toolchain image
run: docker push ghcr.io/steamdeckhomebrew/holo-toolchain-go:latest
docker push --all-tags ghcr.io/steamdeckhomebrew/holo-$IMAGE
done
- name: Log out of GitHub Container Registry
run: |
Expand Down

0 comments on commit 7bbdd30

Please sign in to comment.