Skip to content

Commit

Permalink
show package version in build step
Browse files Browse the repository at this point in the history
  • Loading branch information
qdrvm-ci committed Jun 24, 2024
1 parent a1d72e0 commit caf55dc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/zombie-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
options:
- Release
- Debug
- ReleaseWithDebInfo
- RelWithDebInfo

env:
DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/
Expand Down Expand Up @@ -60,21 +60,24 @@ jobs:
ARTIFACTS_REPO=$(grep '^ARTIFACTS_REPO ?=' Makefile | sed 's/ARTIFACTS_REPO ?= //')
REGION=$(grep '^REGION ?=' Makefile | sed 's/REGION ?= //')
SHORT_COMMIT_HASH=$(grep 'short_commit_hash:' commit_hash.txt | cut -d ' ' -f 2)
PACKAGE_VERSION="${SHORT_COMMIT_HASH}-${{ github.event.inputs.build_type }}"
echo "PACKAGE_VERSION=${PACKAGE_VERSION}"
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
gcloud config set artifacts/repository $ARTIFACTS_REPO
gcloud config set artifacts/location $REGION
PACKAGE_EXIST=$(gcloud artifacts versions list --package=kagome-dev --format=json | jq -e '.[] | select(.name | endswith("${SHORT_COMMIT_HASH}-${{ github.event.inputs.build_type }}"))' > /dev/null && echo "True" || echo "False")
echo "PACKAGE_EXIST=${PACKAGE_EXIST}" >> $GITHUB_ENV
PACKAGE_EXIST=$(gcloud artifacts versions list --package=kagome-dev --format=json | jq -e '.[] | select(.name | endswith("${{ env.PACKAGE_VERSION }}"))' > /dev/null && echo "True" || echo "False")
echo "package_exist=${PACKAGE_EXIST}" >> $GITHUB_ENV
- name: "Cache dependencies"
if: github.env.PACKAGE_EXIST == 'False'
if: env.package_exist == 'False'
uses: actions/cache@v4
with:
path: ${{ env.CACHE_PATH }}
key: ${{ github.job }}-${{ env.CACHE_VERSION }}-${{ github.event.inputs.build_type }}
#save-always: true

- name: "Build target"
if: github.env.PACKAGE_EXIST == 'False'
if: env.package_exist == 'False'
working-directory: ./housekeeping/docker/kagome-dev
run: make kagome_dev_docker_build \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \
Expand All @@ -83,7 +86,7 @@ jobs:
BUILD_TYPE=${{ github.event.inputs.build_type }}

- name: "Push Kagome APT Package"
if: github.env.PACKAGE_EXIST == 'False'
if: env.package_exist == 'False'
working-directory: ./housekeeping/docker/kagome-dev
run: |
SHORT_COMMIT_HASH=$(grep 'short_commit_hash:' commit_hash.txt | cut -d ' ' -f 2)
Expand Down

0 comments on commit caf55dc

Please sign in to comment.