From c58bc5f14e4d650624d2dad3308a3037f966311e Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Mon, 29 Jan 2024 23:32:54 -0500 Subject: [PATCH] CI: Fix tag Linux binaries are uploaded to for Rolling The Rolling binary upload script gets the version from package.json in the repository files, not from the binary itself. So, we need to set this value in the repository's package.json file, regardless of what version the binary itself has. The version string in package.json is used by the Rolling upload script to decide what the tag name will be when creating a new Rolling release. We want timestamped version strings so they are unique, and older releases are not overwritten/clobbered/won't have conflicts (whichever would have happened, not worth finding out). Besides that this restores the convention we had been uploading the Rolling release tags with so far. Set a version timestamp just before building the binaries, like on the other two platforms. Add this to the outputs of the "build" job if on Linux. Then read this output in the "test and upload, Linux" job. Now we have synced timestamps again (as much as we did before building Linux binaries in a Debian 10 Docker container, anyway). The script could be updated to check the binary itself, but this way is easier. --- .github/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a25cc86a..ec2a2a6eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,8 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} container: ${{ matrix.image }} + outputs: + timestamp: ${{ steps.linux-binary-version.outputs.timestamp }} steps: - name: Install build dependencies - Linux @@ -77,6 +79,13 @@ jobs: git submodule init git submodule update + - name: Set Timestamp for Binary Version - Linux + id: linux-binary-version + if: ${{ runner.os == 'Linux' }} + # This output is currently only set for the sake of the Rolling binary upload script. + # See the "test-and-upload-Linux" job below. + run: echo "timestamp=`date -u +%Y%m%d%H`" >> "$GITHUB_OUTPUT" + - name: Check Pulsar Version if: ${{ runner.os != 'Windows' }} run: sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json @@ -257,6 +266,12 @@ jobs: mkdir -p ./tests/videos Xvfb -screen 0 1024x768x24+32 :99 & nohup ffmpeg -video_size 1024x768 -f x11grab -i :99.0 ./tests/videos/out.mpg & DISPLAY=:99 PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list + - name: Check Pulsar Version + if: ${{ runner.os != 'Windows' }} + run: sed -i -e "s/[0-9]*-dev/${TIMESTAMP}/g" package.json + env: + TIMESTAMP: ${{needs.build.outputs.timestamp}} + - name: Add binaries to Rolling Release Repo - Linux if: ${{ github.event_name == 'push' && runner.os == 'Linux' }} # We only want to upload rolling binaries if they are a commit to master