release.yml (8217B)
1 name: release 2 on: 3 schedule: 4 - cron: '5 5 * * *' 5 workflow_dispatch: 6 inputs: 7 tag_name: 8 description: 'Tag name for release' 9 required: false 10 default: nightly 11 push: 12 tags: 13 - v[0-9]+.[0-9]+.[0-9]+ 14 15 # Build on the oldest supported images, so we have broader compatibility 16 jobs: 17 setup: 18 runs-on: ubuntu-latest 19 outputs: 20 build_type: ${{ steps.build.outputs.build_type }} 21 appimage_tag: ${{ steps.build.outputs.appimage_tag }} 22 steps: 23 # Nightly uses RelWithDebInfo while stable uses Release (which disables 24 # asserts). This helps get better debug info from people brave enough to 25 # use the nightly builds. 26 - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') 27 run: | 28 echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV 29 echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV 30 - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') 31 run: | 32 echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV 33 echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV 34 - name: Export build information 35 id: build 36 run: | 37 printf "build_type=${CMAKE_BUILD_TYPE}\n" >> $GITHUB_OUTPUT 38 printf "appimage_tag=${APPIMAGE_TAG}\n" >> $GITHUB_OUTPUT 39 40 linux: 41 needs: setup 42 strategy: 43 fail-fast: false 44 matrix: 45 runner: [ ubuntu-22.04, ubuntu-22.04-arm ] 46 include: 47 - runner: ubuntu-22.04 48 arch: x86_64 49 - runner: ubuntu-22.04-arm 50 arch: arm64 51 runs-on: ${{ matrix.runner }} 52 env: 53 CC: ${{ matrix.cc }} 54 LDAI_NO_APPSTREAM: 1 # skip checking (broken) AppStream metadata for issues 55 outputs: 56 version: ${{ steps.build.outputs.version }} 57 steps: 58 - uses: actions/checkout@v6 59 with: 60 # Perform a full checkout #13471 61 fetch-depth: 0 62 - run: ./.github/scripts/install_deps.sh 63 - run: sudo apt-get install -y libfuse2 64 - run: echo "CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}" >> $GITHUB_ENV 65 - name: appimage 66 run: | 67 ./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }} 68 - name: tar.gz 69 run: cpack --config build/CPackConfig.cmake -G TGZ 70 - uses: actions/upload-artifact@v7 71 with: 72 name: nvim-appimage-${{ matrix.arch }} 73 path: | 74 build/bin/nvim-linux-${{ matrix.arch }}.appimage 75 build/bin/nvim-linux-${{ matrix.arch }}.appimage.zsync 76 retention-days: 1 77 - uses: actions/upload-artifact@v7 78 with: 79 name: nvim-linux-${{ matrix.arch }} 80 path: | 81 build/nvim-linux-${{ matrix.arch }}.tar.gz 82 retention-days: 1 83 - name: Export version 84 id: build 85 run: | 86 printf 'version<<END\n' >> $GITHUB_OUTPUT 87 ./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT 88 printf 'END\n' >> $GITHUB_OUTPUT 89 macos: 90 needs: setup 91 strategy: 92 fail-fast: false 93 matrix: 94 runner: [ macos-15-intel, macos-14 ] 95 include: 96 - runner: macos-15-intel 97 arch: x86_64 98 - runner: macos-14 99 arch: arm64 100 runs-on: ${{ matrix.runner }} 101 env: 102 MACOSX_DEPLOYMENT_TARGET: 11.0 103 steps: 104 - uses: actions/checkout@v6 105 with: 106 # Perform a full checkout #13471 107 fetch-depth: 0 108 - name: Install dependencies 109 run: ./.github/scripts/install_deps.sh 110 111 - name: Build deps 112 run: | 113 cmake -S cmake.deps -B .deps -G Ninja \ 114 -D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \ 115 -D CMAKE_FIND_FRAMEWORK=NEVER 116 cmake --build .deps 117 - name: Build neovim 118 run: | 119 cmake -B build -G Ninja \ 120 -D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \ 121 -D ENABLE_LIBINTL=OFF \ 122 -D CMAKE_FIND_FRAMEWORK=NEVER 123 cmake --build build 124 - name: Package 125 run: cpack --config build/CPackConfig.cmake 126 127 - uses: actions/upload-artifact@v7 128 with: 129 name: nvim-macos-${{ matrix.arch }} 130 path: build/nvim-macos-${{ matrix.arch }}.tar.gz 131 retention-days: 1 132 133 windows: 134 needs: setup 135 strategy: 136 matrix: 137 include: 138 - runner: windows-2022 139 arch: x86_64 140 archive_name: nvim-win64 141 - runner: windows-11-arm 142 arch: arm64 143 archive_name: nvim-win-arm64 144 runs-on: ${{ matrix.runner }} 145 steps: 146 - uses: actions/checkout@v6 147 with: 148 # Perform a full checkout #13471 149 fetch-depth: 0 150 - run: .github/scripts/env.ps1 151 env: 152 BUILD_ARCH: ${{ matrix.arch }} 153 - name: Install Wix 154 run: | 155 Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip" -OutFile "wix314-binaries.zip" 156 Expand-Archive -Path "wix314-binaries.zip" -DestinationPath "C:/wix" 157 echo "C:\wix" >> $env:GITHUB_PATH 158 - name: Build deps 159 run: | 160 cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} 161 cmake --build .deps 162 - name: Build package 163 run: | 164 cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} 165 cmake --build build --target package 166 - name: Upload artifact 167 uses: actions/upload-artifact@v7 168 with: 169 name: nvim-win-${{ matrix.arch }} 170 path: | 171 build/${{ matrix.archive_name }}.zip 172 build/${{ matrix.archive_name }}.msi 173 retention-days: 1 174 175 publish: 176 needs: [linux, macos, windows] 177 runs-on: ubuntu-latest 178 env: 179 GH_REPO: ${{ github.repository }} 180 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 181 permissions: 182 contents: write 183 steps: 184 # Must perform checkout first, since it deletes the target directory 185 # before running, and would therefore delete the downloaded artifacts 186 - uses: actions/checkout@v6 187 188 - uses: actions/download-artifact@v8 189 190 - name: Install dependencies 191 run: sudo apt-get update && sudo apt-get install -y gettext-base 192 193 - if: github.event_name == 'workflow_dispatch' 194 run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV 195 - if: github.event_name == 'schedule' 196 run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV 197 - if: github.event_name == 'push' 198 run: | 199 TAG_NAME=${{ github.ref }} 200 echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV 201 - if: env.TAG_NAME == 'nightly' 202 run: | 203 (echo 'SUBJECT=Nvim development (prerelease) build'; 204 echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV 205 gh release delete nightly --yes || true 206 git push origin :nightly || true 207 - if: env.TAG_NAME != 'nightly' 208 run: | 209 (echo 'SUBJECT=Nvim release build'; 210 echo 'PRERELEASE=') >> $GITHUB_ENV 211 gh release delete stable --yes || true 212 git push origin :stable || true 213 - name: Publish release 214 env: 215 NVIM_VERSION: ${{ needs.linux.outputs.version }} 216 NVIM_COMMIT: ${{ github.sha }} 217 DEBUG: api 218 run: | 219 envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md" 220 if [ "$TAG_NAME" != "nightly" ]; then 221 gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win-x86_64/* nvim-win-arm64/* 222 fi 223 gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win-x86_64/* nvim-win-arm64/*