Skip to content

Commit

Permalink
Merge pull request #26 from menny/env-from-file
Browse files Browse the repository at this point in the history
Read version env variables from file
  • Loading branch information
menny authored Dec 1, 2024
2 parents b2bba37 + e551e82 commit 704858e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .github/docker_build_image.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash
set -e

source "$(dirname -- "${BASH_SOURCE[0]}")/shared_tools_versions.sh"

docker build ${DOCKER_FILE_PATH} --build-arg IMAGE_VERSION="${IMAGE_VERSION}" --build-arg NDK_VERSION="${NDK_VERSION}" --build-arg BAZELISK_VERSION="${BAZELISK_VERSION}" --compress -t "menny/${IMAGE_NAME}:${IMAGE_VERSION}-raw"

SQUASH_MSG=""
Expand Down
2 changes: 0 additions & 2 deletions .github/docker_push_image.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash
set -e

source "$(dirname -- "${BASH_SOURCE[0]}")/shared_tools_versions.sh"

PREVIOUS_SIZE="$(docker manifest inspect menny/${IMAGE_NAME}:latest | jq -r '.config.size + ([.layers[].size] | add)')"

docker image tag menny/${IMAGE_NAME}:${IMAGE_VERSION} menny/${IMAGE_NAME}:latest
Expand Down
7 changes: 0 additions & 7 deletions .github/shared_tools_versions.sh

This file was deleted.

3 changes: 3 additions & 0 deletions .github/versions.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
IMAGE_VERSION=1.21.2
NDK_VERSION=27.2.12479018
BAZELISK_VERSION=v1.24.0
18 changes: 12 additions & 6 deletions .github/workflows/post_merge_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set versions
uses: tw3lveparsecs/github-actions-set-variables@latest
with:
envFilePath: .github/versions.env
- name: base image
env:
IMAGE_NAME: android_base
Expand Down Expand Up @@ -65,6 +69,10 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set versions
uses: tw3lveparsecs/github-actions-set-variables@latest
with:
envFilePath: .github/versions.env
- run: ./.github/docker_build_image.sh
- run: ./.github/docker_push_image.sh
green:
Expand All @@ -81,12 +89,10 @@ jobs:
- green
steps:
- uses: actions/[email protected]
- name: Loading version data
run: |
.github/shared_tools_versions.sh
echo "IMAGE_VERSION=$(echo $IMAGE_VERSION)" >> $GITHUB_ENV
echo "NDK_VERSION=$(echo $NDK_VERSION)" >> $GITHUB_ENV
echo "BAZELISK_VERSION=$(echo $BAZELISK_VERSION)" >> $GITHUB_ENV
- name: Set versions
uses: tw3lveparsecs/github-actions-set-variables@latest
with:
envFilePath: .github/versions.env
- uses: avakar/tag-and-release@v1
with:
tag_name: ${{ env.IMAGE_VERSION }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pre_merge_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
target: Dockerfile android_base/Dockerfile android_bazel/Dockerfile android_ndk/Dockerfile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set versions
uses: tw3lveparsecs/github-actions-set-variables@latest
with:
envFilePath: .github/versions.env
- name: Base Android image
env:
SQUASH_IMAGE: SQUASH
Expand Down

0 comments on commit 704858e

Please sign in to comment.