build: join parsed platform versions with space

* build: join parsed platform versions with space

* ci: add script to set environment variables

* ci: pass github context as variable to bash script
This commit is contained in:
Eligio Mariño
2024-02-16 13:15:51 +01:00
committed by GitHub
parent a37d2817d3
commit 53f89b4aa4
3 changed files with 26 additions and 19 deletions
+5 -6
View File
@@ -7,6 +7,7 @@ on:
- Dockerfile
- config/version.json
- script/docker-entrypoint.sh
- script/set_environment_variables.sh
- test/**
workflow_dispatch:
@@ -44,11 +45,10 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Set environment variables from version.json
run: |
echo "FLUTTER_VERSION=$(jq -r '.flutter.version' ${{ env.VERSION_MANIFEST }})" >> $GITHUB_ENV
echo "FASTLANE_VERSION=$(jq -r '.fastlane.version' ${{ env.VERSION_MANIFEST }})" >> $GITHUB_ENV
echo "ANDROID_PLATFORM_VERSIONS=$(jq -r '.android.platforms[].version' config/version.json)" >> $GITHUB_ENV
- name: Read environment variables from version.json
env:
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
run: ./script/set_environment_variables.sh
- name: Set environment variable for image repository and tag
run: |
@@ -122,7 +122,6 @@ jobs:
# TODO: https://github.com/GoogleContainerTools/kaniko/issues/875
# TODO: Use kaniko for building and pushing after pushing to Docker daemon is solved, to be able to test Docker image, with the following issues
# TODO: https://github.com/GoogleContainerTools/kaniko/issues/1331
# TODO: https://github.com/GoogleContainerTools/kaniko/issues/885
# - name: Build image and push it to registries
# uses: int128/kaniko-action@v1
# with:
+5 -13
View File
@@ -5,6 +5,7 @@ on:
- Dockerfile
- config/version.json
- script/docker-entrypoint.sh
- script/set_environment_variables.sh
workflow_dispatch:
jobs:
@@ -28,19 +29,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set environment variables from version.json
run: |
echo "FLUTTER_VERSION=$(jq -r '.flutter.version' ${{ env.VERSION_MANIFEST }})" >> $GITHUB_ENV
echo "FASTLANE_VERSION=$(jq -r '.fastlane.version' ${{ env.VERSION_MANIFEST }})" >> $GITHUB_ENV
echo "ANDROID_PLATFORM_VERSIONS=$(jq -r '.android.platforms[].version' config/version.json)" >> $GITHUB_ENV
- name: Set environment variable for image repository and tag
run: |
IMAGE_REPOSITORY_PATH="${{ github.repository_owner }}/${{ env.IMAGE_REPOSITORY_NAME }}"
echo "IMAGE_REPOSITORY_PATH=$IMAGE_REPOSITORY_PATH" >> $GITHUB_ENV
CACHE_REPOSITORY_PATH="ghcr.io/$IMAGE_REPOSITORY_PATH"
echo "CACHE_REPOSITORY_PATH=$CACHE_REPOSITORY_PATH" >> $GITHUB_ENV
- name: Read environment variables from version.json
env:
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
run: ./script/set_environment_variables.sh
- name: Load image metadata
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
IMAGE_REPOSITORY_PATH="$GITHUB_REPOSITORY_OWNER/$IMAGE_REPOSITORY_NAME"
CACHE_REPOSITORY_PATH="ghcr.io/$IMAGE_REPOSITORY_PATH"
{
echo "FLUTTER_VERSION=$(jq -r '.flutter.version' "$VERSION_MANIFEST")"
echo "FASTLANE_VERSION=$(jq -r '.fastlane.version' "$VERSION_MANIFEST")"
echo "ANDROID_PLATFORM_VERSIONS=$(jq -r '.android.platforms[].version' "$VERSION_MANIFEST")"
echo "IMAGE_REPOSITORY_PATH=$IMAGE_REPOSITORY_PATH"
echo "CACHE_REPOSITORY_PATH=$CACHE_REPOSITORY_PATH"
} >>"$GITHUB_ENV"