From 4d07f47da1a3a676f4f2227942ee3db239f36686 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Thu, 25 Jun 2026 17:03:41 +0200 Subject: [PATCH] Generate a versions.json file --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d177ca18e..1c177cd68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ env: AWS_BUCKET: ${{ vars.NIGHTLY_BUILD_AWS_BUCKET }} AWS_REGION: ${{ vars.NIGHTLY_BUILD_AWS_REGION }} AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ vars.AWS_CF_DISTRIBUTION_NIGHTLY }} + AWS_CLOUDFRONT_GET_ID: ${{ vars.AWS_CF_GET }} RELEASE: ${{ github.ref_type == 'tag' && github.ref_name || 'nightly' }} VERSION_FLAG: ${{ github.ref_type == 'tag' && format('-Dversion={0}', github.ref_name) || '-Dversion=nightly' }} @@ -142,6 +143,35 @@ jobs: needs: build-linux uses: ./.github/workflows/package-debian.yml + update-versions: + needs: [build-linux, build-macos] + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Download linux x86_64 binary (to read the version) + uses: actions/download-artifact@v4 + with: + name: lightpanda-x86_64-linux + + - name: "Generate and publish versions.json" + run: | + chmod +x lightpanda-x86_64-linux + VERSION=$(./lightpanda-x86_64-linux version) + aws s3 cp s3://lpd-nightly-build/get/versions.json current.json --content-type application/json + docker run --rm -v "$PWD:/work" -w /work \ + ghcr.io/lightpanda-io/version-fmt:latest \ + -release "${RELEASE}" -version "${VERSION}" /work/current.json > new.json + aws s3 cp new.json s3://lpd-nightly-build/get/versions.json --content-type application/json + aws cloudfront create-invalidation --distribution-id ${{ env.AWS_CLOUDFRONT_GET_ID }} --paths "/versions.json" + invalidate-cloudfront: needs: [build-linux, build-macos] runs-on: ubuntu-22.04