diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7c4b7f63..d4a565376 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,7 +103,7 @@ jobs: - name: ⬆️ Upload Portable ZIP uses: actions/upload-artifact@v3 with: - name: Windows Portable ZIP + name: Windows Portable path: | build/install/* @@ -238,6 +238,10 @@ jobs: .. make -j 4 install DESTDIR=AppDir + - name: 📜 Set version variable + run: | + echo "version=`cat build/version`" >> $GITHUB_ENV + #- name: 📦 Bundle Flatpak # run: | # sudo apt install flatpak flatpak-builder @@ -251,14 +255,14 @@ jobs: run: | cp -r build/DEBIAN build/AppDir dpkg-deb --build build/AppDir - mv build/AppDir.deb imhex.deb + mv build/AppDir.deb imhex-${{env.version}}.deb rm -rf build/AppDir/DEBIAN - name: 📦 Bundle AppImage run: | cd build appimage-builder --recipe ../dist/AppImageBuilder.yml - mv ImHex-AppImage-x86_64.AppImage ../imhex.AppImage + mv ImHex-AppImage-x86_64.AppImage ../imhex-${{env.version}}.AppImage cd .. #- name: ⬆️ Upload Flatpak @@ -272,13 +276,11 @@ jobs: uses: actions/upload-artifact@v3 with: name: Linux DEB (Ubuntu 22.04) - path: | - imhex.deb + path: '*.deb' - name: ⬆️ Upload AppImage uses: actions/upload-artifact@v3 with: name: Linux AppImage - path: | - imhex.AppImage + path: '*.AppImage' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be8d429d0..0cec7965b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,9 @@ on: jobs: release: runs-on: ubuntu-latest + name: Release + env: + version: ${{ github.event.release.tag_name }} steps: - name: Get sources @@ -26,13 +29,28 @@ jobs: with: github_token: ${{secrets.GITHUB_TOKEN}} workflow: build.yml - branch: master + branch: ${{ github.event.release.target_commitish }} workflow_conclusion: success skip_unpack: true - + + - name: Unzip files when needed + run: | + for zipfile in ./*.zip + do + if [ `zipinfo -1 "$zipfile" | wc -l` -eq 1 ]; + then + echo "unzipping $zipfile" + unzip "$zipfile" + rm "$zipfile" + else + echo "keeping $zipfile zipped" + fi + done + + - name: Rename Windows Portable Zip + run: mv "Windows Portable.zip" imhex-${{env.version}}-Windows-Portable.zip + - name: Upload everything to release uses: softprops/action-gh-release@v1 with: - files: | - *.zip - *.tar.gz + files: '*' diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 26692f17f..7a61526e2 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -222,12 +222,16 @@ macro(createPackage) install(FILES "$" DESTINATION "${CMAKE_INSTALL_LIBDIR}") downloadImHexPatternsFiles("./") elseif(UNIX AND NOT APPLE) - configure_file(${CMAKE_SOURCE_DIR}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control) + + configure_file(${CMAKE_SOURCE_DIR}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control) + install(FILES ${CMAKE_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) install(FILES ${CMAKE_SOURCE_DIR}/resources/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.png) install(FILES "$" DESTINATION "${CMAKE_INSTALL_LIBDIR}") downloadImHexPatternsFiles("./") endif() + + write_file(version ${PROJECT_VERSION}) if (CREATE_BUNDLE) include(PostprocessBundle)