From 1c970e9ff658e2d4838d4a1c565eca75e9c37080 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Wed, 28 Jan 2026 10:47:13 +1100 Subject: [PATCH] chore(ci): Rename release artifacts (#1389) --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 39 ++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f19eb61..ef35dc0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: - name: Check `nph` formatting uses: arnetheduck/nph-action@v1 with: - version: 0.6.1 + version: latest options: "codex/ tests/" fail: true suggest: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4725a375..543b7cc6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ on: env: cache_nonce: 0 # Allows for easily busting actions/cache caches nim_version: pinned - storage_binary_base: storage + storage_binary_base: logos-storage build_dir: build nim_flags: '' windows_libs: 'libstdc++-6.dll libgomp-1.dll libgcc_s_seh-1.dll libwinpthread-1.dll' @@ -49,6 +49,16 @@ jobs: runs-on: ${{ matrix.builder }} timeout-minutes: 80 steps: + - name: Set version variable + shell: bash + run: | + if [[ "${{ github.ref_type }}" == "tag" ]]; then + echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV + echo "TAGGED_RELEASE=true" >> $GITHUB_ENV + else + echo "VERSION=${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "TAGGED_RELEASE=false" >> $GITHUB_ENV + fi - name: Release - Checkout sources uses: actions/checkout@v4 with: @@ -69,8 +79,7 @@ jobs: macos*) os_name="darwin" ;; windows*) os_name="windows" ;; esac - github_ref_name="${GITHUB_REF_NAME/\//-}" - storage_binary="${{ env.storage_binary_base }}-${github_ref_name}-${os_name}-${{ matrix.cpu }}" + storage_binary="${{ env.storage_binary_base }}-${os_name}-${{ matrix.cpu }}-${{ env.VERSION }}" if [[ ${os_name} == "windows" ]]; then storage_binary="${storage_binary}.exe" fi @@ -110,7 +119,7 @@ jobs: - name: Release - Upload Logos Storage build artifacts uses: actions/upload-artifact@v4 with: - name: release-${{ env.storage_binary }} + name: ${{ env.storage_binary }} path: ${{ env.build_dir }}/${{ env.storage_binary_base }}* retention-days: 30 @@ -118,22 +127,24 @@ jobs: if: matrix.os == 'windows' uses: actions/upload-artifact@v4 with: - name: release-${{ matrix.os }}-libs + name: ${{ env.storage_binary }}-dlls path: ${{ env.build_dir }}/*.dll retention-days: 30 - - name: Release -Package artifacts Linux + - name: Release - Package artifacts Linux if: matrix.os == 'linux' run: | sudo apt-get update && sudo apt-get install -y zip - ZIPFILE=libstorage-linux-${{ matrix.cpu }}.zip + github_ref_name="${GITHUB_REF_NAME/\//-}" + ZIPFILE=libstorage-linux-${{ matrix.cpu }}-${{ env.VERSION }}.zip zip -j $ZIPFILE ./build/libstorage.so ./library/libstorage.h echo "ZIPFILE=$ZIPFILE" >> $GITHUB_ENV - + - name: Package artifacts MacOS if: matrix.os == 'macos' run: | - ZIPFILE=libstorage-macos-${{ matrix.cpu }}.zip + github_ref_name="${GITHUB_REF_NAME/\//-}" + ZIPFILE=libstorage-macos-${{ matrix.cpu }}-${{ env.VERSION }}.zip zip -j $ZIPFILE ./build/libstorage.dylib ./library/libstorage.h echo "ZIPFILE=$ZIPFILE" >> $GITHUB_ENV @@ -141,7 +152,7 @@ jobs: if: matrix.os == 'windows' shell: msys2 {0} run: | - ZIPFILE=libstorage-windows-${{ matrix.cpu }}.zip + ZIPFILE=libstorage-windows-${{ matrix.cpu }}-${{ env.VERSION }}.zip (cd ./build && 7z a -tzip "${GITHUB_WORKSPACE}/${ZIPFILE}" libstorage.dll) (cd ./library && 7z a -tzip "${GITHUB_WORKSPACE}/${ZIPFILE}" libstorage.h) echo "ZIPFILE=$ZIPFILE" >> $GITHUB_ENV @@ -162,7 +173,7 @@ jobs: - name: Release - Download binaries uses: actions/download-artifact@v4 with: - pattern: release* + pattern: ${{ env.storage_binary_base }}* merge-multiple: true path: /tmp/release @@ -226,7 +237,7 @@ jobs: folder="/tmp/release" # Tagged releases - if [[ "${{ github.ref }}" == *"refs/tags/"* ]]; then + if [[ "${{ env.TAGGED_RELEASE }}" == "true" ]]; then aws s3 cp --recursive "${folder}" s3://${{ env.s3_bucket }}/releases/${branch} --endpoint-url ${{ env.s3_endpoint }} echo "${branch}" > "${folder}"/latest aws s3 cp "${folder}"/latest s3://${{ env.s3_bucket }}/releases/latest --endpoint-url ${{ env.s3_endpoint }} @@ -243,7 +254,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + if: env.TAGGED_RELEASE with: files: | /tmp/release/* @@ -251,7 +262,7 @@ jobs: - name: Generate Python SDK uses: peter-evans/repository-dispatch@v3 - if: startsWith(github.ref, 'refs/tags/') + if: env.TAGGED_RELEASE with: token: ${{ secrets.DISPATCH_PAT }} repository: logos-storage/logos-storage-py-api-client