Skip to content

fix more

fix more #5

name: Build and Push Database Exporter
on:
push:
branches:
- lma/release/github_actions
env:
UBUNTU_VERSION: '20.04'
GHC_VERSION: '9.6.4'
STATIC_LIBRARIES_IMAGE_TAG: 'rust-1.73.0_ghc-9.6.4'
VERSION: '7.0.5-0'
jobs:
build-database-exporter:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
# - name: Extract version tag from Cargo.toml manifest
# id: meta
# run: |
# VERSION=$(yq .package.version concordium-node/Cargo.toml)
# echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Precheck - Validate Version and Check S3 for existing files
run: |
OUTFILE="s3://distribution.concordium.software/tools/linux/database-exporter_${{ env.VERSION }}.deb"
totalFoundObjects=$(aws s3 ls "$OUTFILE" --summarize | grep "Total Objects: " | sed "s/[^0-9]*//g")
if [ "$totalFoundObjects" -ne "0" ]; then
echo "error: $OUTFILE already exists"
exit 1
fi
- name: Build
uses: docker/build-push-action@v6
with:
push: false
tags: build-deb:${{ github.run_id }}
file: scripts/db-exporter/Dockerfile
build-args: |
- ubuntu_version=${{ env.UBUNTU_VERSION }}
- version=${{ env.VERSION }}
- ghc_version=${{ env.GHC_VERSION }}
- static_libraries_image_tag=${{ env.STATIC_LIBRARIES_IMAGE_TAG }}
labels: |
- ubuntu_version=${{ env.UBUNTU_VERSION }}
- version=${{ env.VERSION }}
- ghc_version=${{ env.GHC_VERSION }}
- static_libraries_image_tag=${{ env.STATIC_LIBRARIES_IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
# - name: Build Docker Image
# run: |
# docker build \
# --build-arg ubuntu_version="${{ env.UBUNTU_VERSION }}" \
# --build-arg version="${{ env.VERSION }}" \
# --build-arg ghc_version="${{ env.GHC_VERSION }}" \
# --build-arg static_libraries_image_tag="${{ env.STATIC_LIBRARIES_IMAGE_TAG }}" \
# --label ubuntu_version="${{ env.UBUNTU_VERSION }}" \
# --label version="${{ env.VERSION }}" \
# --label ghc_version="${{ env.GHC_VERSION }}" \
# --label static_libraries_image_tag="${{ env.STATIC_LIBRARIES_IMAGE_TAG }}" \
# -f "scripts/db-exporter/Dockerfile" \
# -t build-deb:${{ github.run_id }} \
# .
- name: Run Docker and Extract Artifacts
run: |
docker run -v "${{ env.OUT_DIR }}":/out build-deb:${{ github.run_id }}
- name: Finish
run: |
ls -la /out
# - name: Upload to S3
# run: |
# aws s3 cp "${{ env.OUT_DIR }}/database-exporter_${{ steps.set_version.outputs.TAG }}.deb" \
# "${OUTFILE}" --grants=read=uri=http://acs.amazonaws.com/groups/global/AllUsers
# env:
# OUTFILE: s3://distribution.concordium.software/tools/linux/database-exporter_${{ steps.set_version.outputs.TAG }}.deb