From d462b2931be0ec70f38f7e5f345c6b015e4eb292 Mon Sep 17 00:00:00 2001 From: Michal Pelka Date: Sun, 27 Sep 2026 00:09:51 +0200 Subject: [PATCH 1/2] Attach build artifacts to GitHub releases Run the Linux .deb, macOS and Windows workflows on published releases and upload their packages as release assets. Upload the Windows deploy folder as the Actions artifact instead of the zip, to avoid a zip nested inside the artifact zip. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cmake-linux-deb.yml | 10 ++++++++++ .github/workflows/macos.yml | 10 ++++++++++ .github/workflows/windows.yml | 15 ++++++++++++--- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-linux-deb.yml b/.github/workflows/cmake-linux-deb.yml index ac0bfb07..666b53f3 100644 --- a/.github/workflows/cmake-linux-deb.yml +++ b/.github/workflows/cmake-linux-deb.yml @@ -7,6 +7,8 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + release: + types: [ published ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -18,6 +20,8 @@ jobs: # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-24.04 + permissions: + contents: write steps: - name: Load repository cache @@ -55,3 +59,9 @@ jobs: with: name: hd_mapping-deb path: ${{github.workspace}}/build/*.deb + + - name: Attach to GitHub release + if: github.event_name == 'release' + uses: softprops/action-gh-release@v2 + with: + files: ${{github.workspace}}/build/*.deb diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1bf434c2..921bba01 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -5,6 +5,8 @@ on: branches: ["main"] pull_request: branches: ["main"] + release: + types: [published] env: BUILD_TYPE: Release @@ -12,6 +14,8 @@ env: jobs: build: runs-on: macos-latest + permissions: + contents: write steps: - uses: actions/checkout@v4 @@ -68,3 +72,9 @@ jobs: path: ${{github.workspace}}/build/HDMapping.dmg retention-days: 90 compression-level: 0 + + - name: Attach to GitHub release + if: github.event_name == 'release' + uses: softprops/action-gh-release@v2 + with: + files: ${{github.workspace}}/build/HDMapping.dmg diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bfd11112..06c5a4d2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -7,6 +7,8 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + release: + types: [ published ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -18,6 +20,8 @@ jobs: # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: windows-latest + permissions: + contents: write steps: @@ -51,9 +55,14 @@ jobs: shell: cmd run: deploy_mandeye.bat "${{github.workspace}}\deploy\mandeye" - - name: Upload mandeye ZIP as artifact + - name: Upload mandeye folder as artifact uses: actions/upload-artifact@v4 with: - name: mandeye-zip-windows - path: ${{github.workspace}}/deploy/*.zip + name: mandeye-windows + path: ${{github.workspace}}/deploy/mandeye/ + - name: Attach to GitHub release + if: github.event_name == 'release' + uses: softprops/action-gh-release@v2 + with: + files: ${{github.workspace}}/deploy/*.zip From 32ef7c93b1141ecb0904a54c9044faedfc49c084 Mon Sep 17 00:00:00 2001 From: Michal Pelka Date: Sun, 27 Sep 2026 00:10:47 +0200 Subject: [PATCH 2/2] Add version to build artifact names Derive VERSION from git describe (release tag on release builds) and use it in the .deb and .dmg file names and the Actions artifact names. Fetch full history so tags are available, which also fixes the "notag" name of the Windows mandeye zip on push builds. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cmake-linux-deb.yml | 8 ++++++-- .github/workflows/macos.yml | 11 ++++++++--- .github/workflows/windows.yml | 7 ++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake-linux-deb.yml b/.github/workflows/cmake-linux-deb.yml index 666b53f3..bbbe1f62 100644 --- a/.github/workflows/cmake-linux-deb.yml +++ b/.github/workflows/cmake-linux-deb.yml @@ -32,6 +32,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 + + - name: Set version + run: echo "VERSION=$(git describe --tags --always)" >> "$GITHUB_ENV" - name: Install CMake 4.0 run: | @@ -42,7 +46,7 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_WITH_UTILITY_APPLICATION=ON -DBUILD_WITH_BUNDLED_FREEGLUT=0 -DBUILD_WITH_BUNDLED_EIGEN=0 -DBUILD_WITH_BUNDLED_LIBLASZIP=0 -DBUILD_TESTING=ON + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_WITH_UTILITY_APPLICATION=ON -DBUILD_WITH_BUNDLED_FREEGLUT=0 -DBUILD_WITH_BUNDLED_EIGEN=0 -DBUILD_WITH_BUNDLED_LIBLASZIP=0 -DBUILD_TESTING=ON -DCPACK_PACKAGE_FILE_NAME=hd_mapping-${{env.VERSION}}-amd64 - name: Build # Build your program with the given configuration @@ -57,7 +61,7 @@ jobs: - name: Upload Debian package as artifact uses: actions/upload-artifact@v4 with: - name: hd_mapping-deb + name: hd_mapping-deb-${{env.VERSION}} path: ${{github.workspace}}/build/*.deb - name: Attach to GitHub release diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 921bba01..3b86f68d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -21,6 +21,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 + + - name: Set version + run: echo "VERSION=$(git describe --tags --always)" >> "$GITHUB_ENV" - name: Install dependencies via Homebrew run: | @@ -64,12 +68,13 @@ jobs: chmod +x ${{github.workspace}}/macos_bundle_toolkit/create_dir_bundle_dmg.sh cd ${{github.workspace}} ./macos_bundle_toolkit/create_dir_bundle_dmg.sh + mv build/HDMapping.dmg "build/HDMapping-${VERSION}.dmg" - name: Upload DMG Artifact uses: actions/upload-artifact@v4 with: - name: hdmapping-macos-dmg - path: ${{github.workspace}}/build/HDMapping.dmg + name: hdmapping-macos-dmg-${{env.VERSION}} + path: ${{github.workspace}}/build/HDMapping-${{env.VERSION}}.dmg retention-days: 90 compression-level: 0 @@ -77,4 +82,4 @@ jobs: if: github.event_name == 'release' uses: softprops/action-gh-release@v2 with: - files: ${{github.workspace}}/build/HDMapping.dmg + files: ${{github.workspace}}/build/HDMapping-${{env.VERSION}}.dmg diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 06c5a4d2..c66d7469 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -28,6 +28,11 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 + + - name: Set version + shell: bash + run: echo "VERSION=$(git describe --tags --always)" >> "$GITHUB_ENV" - name: Install CMake 4.0 on Windows run: | @@ -58,7 +63,7 @@ jobs: - name: Upload mandeye folder as artifact uses: actions/upload-artifact@v4 with: - name: mandeye-windows + name: mandeye-windows-${{env.VERSION}} path: ${{github.workspace}}/deploy/mandeye/ - name: Attach to GitHub release