diff --git a/.github/scripts/build_universal_macos.sh b/.github/scripts/build_universal_macos.sh index 392eec62ac..e5f447ea1c 100755 --- a/.github/scripts/build_universal_macos.sh +++ b/.github/scripts/build_universal_macos.sh @@ -27,10 +27,8 @@ cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D cmake --build .deps cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 cmake --build build -cmake --install build --prefix build/release/nvim-macos -cd build # Make sure we build everything for M1 as well -for macho in bin/* lib/nvim/parser/*.so; do +for macho in build/bin/* build/lib/nvim/parser/*.so; do lipo -info "$macho" | grep -q arm64 || exit 1 done -cpack -C "$NVIM_BUILD_TYPE" +cpack --config build/CPackConfig.cmake diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 219ad0288f..53110461c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,39 +17,10 @@ on: jobs: linux: runs-on: ubuntu-20.04 + env: + CC: gcc-10 outputs: version: ${{ steps.build.outputs.version }} - release: ${{ steps.build.outputs.release }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Install dependencies - run: ./.github/scripts/install_deps.sh - - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV - - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV - - name: Build release - id: build - run: | - CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=" - printf 'version<> $GITHUB_OUTPUT - ./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT - printf 'END\n' >> $GITHUB_OUTPUT - printf 'release=%s\n' "$(./build/bin/nvim --version | head -n 1)" >> $GITHUB_OUTPUT - make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install - cd "$GITHUB_WORKSPACE/build/" - cpack -C $NVIM_BUILD_TYPE - - uses: actions/upload-artifact@v3 - with: - name: nvim-linux64 - path: | - build/nvim-linux64.tar.gz - retention-days: 1 - - appimage: - runs-on: ubuntu-20.04 container: image: ubuntu:18.04 options: --privileged # Privileged mode is needed to load fuse module. @@ -71,11 +42,19 @@ jobs: - name: Install dependencies run: | apt-get update - apt-get install -y build-essential cmake gettext locales ninja-build pkg-config unzip + apt-get install -y build-essential cmake gettext ninja-build unzip - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - run: CC=gcc-10 make appimage-latest + run: | + echo 'NVIM_BUILD_TYPE=Release' >> $GITHUB_ENV + echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - run: CC=gcc-10 make appimage-nightly + run: | + echo 'NVIM_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV + echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV + - name: appimage + run: ./scripts/genappimage.sh ${APPIMAGE_TAG} + - name: tar.gz + run: cpack --config build/CPackConfig.cmake -G TGZ - uses: actions/upload-artifact@v3 with: name: appimage @@ -83,6 +62,18 @@ jobs: build/bin/nvim.appimage build/bin/nvim.appimage.zsync retention-days: 1 + - uses: actions/upload-artifact@v3 + with: + name: nvim-linux64 + path: | + build/nvim-linux64.tar.gz + retention-days: 1 + - name: Export version + id: build + run: | + printf 'version<> $GITHUB_OUTPUT + ./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT + printf 'END\n' >> $GITHUB_OUTPUT macOS: runs-on: macos-11 @@ -137,7 +128,7 @@ jobs: retention-days: 1 publish: - needs: [linux, appimage, macOS, windows] + needs: [linux, macOS, windows] runs-on: ubuntu-latest env: GH_REPO: ${{ github.repository }} diff --git a/cmake.packaging/CMakeLists.txt b/cmake.packaging/CMakeLists.txt index b5c91ac457..c693e2f9ac 100644 --- a/cmake.packaging/CMakeLists.txt +++ b/cmake.packaging/CMakeLists.txt @@ -1,6 +1,7 @@ set(CPACK_PACKAGE_NAME "Neovim") set(CPACK_PACKAGE_VENDOR "neovim.io") set(CPACK_PACKAGE_FILE_NAME "nvim") +set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}) # From the GitHub About section set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.") diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh index 9944b5eb31..b0bf186f85 100755 --- a/scripts/genappimage.sh +++ b/scripts/genappimage.sh @@ -26,7 +26,7 @@ APP_DIR="$APP.AppDir" ######################################################################## # Build and install nvim into the AppImage -make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr -DCMAKE_INSTALL_MANDIR=man" +make CMAKE_BUILD_TYPE="${NVIM_BUILD_TYPE}" CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr -DCMAKE_INSTALL_MANDIR=man" make install ########################################################################