robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
aa1d8a2702
master
1name : release 2on : 3schedule : 4- cron : '5 5 * * *' 5workflow_dispatch : 6inputs : 7tag_name : 8description : 'Tag name for release' 9required : false 10default : nightly 11push : 12tags : 13- v[0-9]+.[0-9]+.[0-9]+ 14 15permissions : 16contents : read 17 18# Build on the oldest supported images, so we have broader compatibility 19jobs : 20setup : 21runs-on : ubuntu-latest 22outputs : 23build_type : ${{ steps.build.outputs.build_type }} 24appimage_tag : ${{ steps.build.outputs.appimage_tag }} 25steps : 26# Nightly uses RelWithDebInfo while stable uses Release (which disables 27# asserts). This helps get better debug info from people brave enough to 28# use the nightly builds. 29- if : github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') 30run : | 31echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV 32echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV 33- if : github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') 34run : | 35echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV 36echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV 37- name : Export build information 38id : build 39run : | 40printf "build_type=${CMAKE_BUILD_TYPE}\n" >> $GITHUB_OUTPUT 41printf "appimage_tag=${APPIMAGE_TAG}\n" >> $GITHUB_OUTPUT 42 43linux : 44needs : setup 45strategy : 46fail-fast : false 47matrix : 48runner : [ ubuntu-22.04 , ubuntu-22.04-arm ] 49include : 50- runner : ubuntu-22.04 51arch : x86_64 52- runner : ubuntu-22.04-arm 53arch : arm64 54runs-on : ${{ matrix.runner }} 55env : 56CC : ${{ matrix.cc }} 57LDAI_NO_APPSTREAM : 1 # skip checking (broken) AppStream metadata for issues 58outputs : 59version : ${{ steps.build.outputs.version }} 60steps : 61- uses : actions/checkout@v7.0.1 62with : 63# Perform a full checkout #13471 64fetch-depth : 0 65persist-credentials : false 66- run : ./.github/scripts/install_deps.sh 67- run : sudo apt-get install -y libfuse2 68 69- run : echo "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" >> $GITHUB_ENV 70env : 71CMAKE_BUILD_TYPE : ${{ needs.setup.outputs.build_type }} 72 73- name : appimage 74env : 75APPIMAGE_TAG : ${{ needs.setup.outputs.appimage_tag }} 76run : | 77./scripts/genappimage.sh "${APPIMAGE_TAG}" 78 79- name : tar.gz 80run : cpack --config build/CPackConfig.cmake -G TGZ 81- uses : actions/upload-artifact@v7 82with : 83name : nvim-appimage-${{ matrix.arch }} 84path : | 85build/bin/nvim-linux-${{ matrix.arch }}.appimage 86build/bin/nvim-linux-${{ matrix.arch }}.appimage.zsync 87retention-days : 1 88- uses : actions/upload-artifact@v7 89with : 90name : nvim-linux-${{ matrix.arch }} 91path : | 92build/nvim-linux-${{ matrix.arch }}.tar.gz 93retention-days : 1 94- name : Export version 95id : build 96run : | 97printf 'version<<END\n' >> $GITHUB_OUTPUT 98./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT 99printf 'END\n' >> $GITHUB_OUTPUT 100macos : 101needs : setup 102strategy : 103fail-fast : false 104matrix : 105runner : [ macos-15-intel , macos-15 ] 106include : 107- runner : macos-15-intel 108arch : x86_64 109- runner : macos-15 110arch : arm64 111runs-on : ${{ matrix.runner }} 112env : 113CMAKE_BUILD_TYPE : ${{ needs.setup.outputs.build_type }} 114MACOSX_DEPLOYMENT_TARGET : 11.0 115steps : 116- uses : actions/checkout@v7.0.1 117with : 118# Perform a full checkout #13471 119fetch-depth : 0 120persist-credentials : false 121- name : Install dependencies 122run : ./.github/scripts/install_deps.sh 123 124- name : Build deps 125run : | 126cmake -S cmake.deps -B .deps -G Ninja \ 127-D CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \ 128-D CMAKE_FIND_FRAMEWORK=NEVER 129cmake --build .deps 130- name : Build neovim 131run : | 132cmake -B build -G Ninja \ 133-D CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \ 134-D ENABLE_LIBINTL=OFF \ 135-D CMAKE_FIND_FRAMEWORK=NEVER 136cmake --build build 137- name : Package 138run : cpack --config build/CPackConfig.cmake 139 140- uses : actions/upload-artifact@v7 141with : 142name : nvim-macos-${{ matrix.arch }} 143path : build/nvim-macos-${{ matrix.arch }}.tar.gz 144retention-days : 1 145 146windows : 147needs : setup 148strategy : 149matrix : 150include : 151- runner : windows-2022 152arch : x86_64 153archive_name : nvim-win64 154- runner : windows-11-arm 155arch : arm64 156archive_name : nvim-win-arm64 157runs-on : ${{ matrix.runner }} 158env : 159CMAKE_BUILD_TYPE : ${{ needs.setup.outputs.build_type }} 160steps : 161- uses : actions/checkout@v7.0.1 162with : 163# Perform a full checkout #13471 164fetch-depth : 0 165persist-credentials : false 166- run : .github/scripts/env.ps1 167env : 168BUILD_ARCH : ${{ matrix.arch }} 169- name : Install Wix 170run : | 171Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip" -OutFile "wix314-binaries.zip" 172Expand-Archive -Path "wix314-binaries.zip" -DestinationPath "C:/wix" 173echo "C:\wix" >> $env:GITHUB_PATH 174- name : Build deps 175shell : pwsh 176run : | 177cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE="${env:CMAKE_BUILD_TYPE}" 178cmake --build .deps 179- name : Build package 180shell : pwsh 181run : | 182cmake -B build -G Ninja -DCMAKE_BUILD_TYPE="${env:CMAKE_BUILD_TYPE}" 183cmake --build build --target package 184- name : Upload artifact 185uses : actions/upload-artifact@v7 186with : 187name : nvim-win-${{ matrix.arch }} 188path : | 189build/${{ matrix.archive_name }}.zip 190build/${{ matrix.archive_name }}.msi 191retention-days : 1 192 193wasm : 194needs : setup 195runs-on : ubuntu-24.04 196 197steps : 198- name : Checkout 199uses : actions/checkout@v7 200with : 201persist-credentials : false 202 203- name : Set up Zig 204uses : mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 205with : 206version : 0.16.0 207use-cache : false 208 209- name : Install system deps 210run : | 211sudo apt-get update 212sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \ 213python3 python3-pip curl unzip zip 214 215- name : Install Emscripten SDK 216run : | 217set -euo pipefail 218git clone https://github.com/emscripten-core/emsdk.git ./.emsdk 219cd ./.emsdk 220./emsdk install 6.0.2 221./emsdk activate 6.0.2 222cd - 223 224- name : Build nvim.wasm 225run : .github/scripts/build_wasm.sh 226env : 227BUNDLE_WASM : "1" 228 229- name : Upload wasm artifact 230uses : actions/upload-artifact@v7 231with : 232name : nvim-wasm-emscripten 233path : nvim-wasm-emscripten.zip 234retention-days : 1 235 236publish : 237needs : [ linux , macos , windows , wasm ] 238runs-on : ubuntu-latest 239env : 240GH_REPO : ${{ github.repository }} 241GH_TOKEN : ${{ secrets.GITHUB_TOKEN }} 242permissions : 243contents : write 244steps : 245# Must perform checkout first, since it deletes the target directory 246# before running, and would therefore delete the downloaded artifacts 247- uses : actions/checkout@v7.0.1 248with : 249persist-credentials : false 250 251- uses : actions/download-artifact@v8 252 253- name : Install dependencies 254run : sudo apt-get update && sudo apt-get install -y gettext-base 255 256- if : github.event_name == 'workflow_dispatch' 257env : 258TAG_NAME : ${{ github.event.inputs.tag_name }} 259run : echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV 260 261- if : github.event_name == 'schedule' 262run : echo 'TAG_NAME=nightly' >> $GITHUB_ENV 263 264- if : github.event_name == 'push' 265run : | 266echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV 267 268- if : env.TAG_NAME == 'nightly' 269run : | 270(echo 'SUBJECT=Nvim development (prerelease) build'; 271echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV 272gh release delete nightly --yes || true 273git push https://${GITHUB_ACTOR}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY} :nightly || true 274 275- if : env.TAG_NAME != 'nightly' 276run : | 277(echo 'SUBJECT=Nvim release build'; 278echo 'PRERELEASE=') >> $GITHUB_ENV 279gh release delete stable --yes || true 280git push https://${GITHUB_ACTOR}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY} :stable || true 281 282- name : Publish release 283env : 284NVIM_VERSION : ${{ needs.linux.outputs.version }} 285NVIM_COMMIT : ${{ github.sha }} 286DEBUG : api 287run : | 288 envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md" 289 if [ "$TAG_NAME" != "nightly" ]; then 290 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/* nvim-wasm-emscripten/* 291 fi 292 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/* nvim-wasm-emscripten/*