release #1496
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
schedule: | |
- cron: '5 5 * * *' | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: 'Tag name for release' | |
required: false | |
default: nightly | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
# Build on the oldest supported images, so we have broader compatibility | |
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04) | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
build_type: ${{ steps.build.outputs.build_type }} | |
appimage_tag: ${{ steps.build.outputs.appimage_tag }} | |
steps: | |
# Nightly uses RelWithDebInfo while stable uses Release (which disables | |
# asserts). This helps get better debug info from people brave enough to | |
# use the nightly builds. | |
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') | |
run: | | |
echo 'CMAKE_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: | | |
echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV | |
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV | |
- name: Export build information | |
id: build | |
run: | | |
printf "build_type=${CMAKE_BUILD_TYPE}\n" >> $GITHUB_OUTPUT | |
printf "appimage_tag=${APPIMAGE_TAG}\n" >> $GITHUB_OUTPUT | |
linux: | |
needs: setup | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: [ ubuntu-20.04, ubuntu-24.04-arm ] | |
include: | |
- runner: ubuntu-20.04 | |
arch: x86_64 | |
cc: gcc-10 | |
- runner: ubuntu-24.04-arm | |
arch: arm64 | |
runs-on: ${{ matrix.runner }} | |
env: | |
CC: ${{ matrix.cc }} | |
LDAI_NO_APPSTREAM: 1 # skip checking (broken) AppStream metadata for issues | |
outputs: | |
version: ${{ steps.build.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Perform a full checkout #13471 | |
fetch-depth: 0 | |
- run: ./.github/scripts/install_deps.sh | |
- run: echo "CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}" >> $GITHUB_ENV | |
- if: matrix.arch == 'arm64' | |
run: sudo apt-get update && sudo apt-get install -y libfuse2t64 | |
- name: appimage | |
run: | | |
./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }} | |
- name: tar.gz | |
run: cpack --config build/CPackConfig.cmake -G TGZ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: nvim-appimage-${{ matrix.arch }} | |
path: | | |
build/bin/nvim-linux-${{ matrix.arch }}.appimage | |
build/bin/nvim-linux-${{ matrix.arch }}.appimage.zsync | |
retention-days: 1 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: nvim-linux-${{ matrix.arch }} | |
path: | | |
build/nvim-linux-${{ matrix.arch }}.tar.gz | |
retention-days: 1 | |
- name: Export version | |
id: build | |
run: | | |
printf 'version<<END\n' >> $GITHUB_OUTPUT | |
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT | |
printf 'END\n' >> $GITHUB_OUTPUT | |
macos: | |
needs: setup | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: [ macos-13, macos-14 ] | |
include: | |
- runner: macos-13 | |
arch: x86_64 | |
- runner: macos-14 | |
arch: arm64 | |
runs-on: ${{ matrix.runner }} | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 11.0 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Perform a full checkout #13471 | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: ./.github/scripts/install_deps.sh | |
- name: Build deps | |
run: | | |
cmake -S cmake.deps -B .deps -G Ninja \ | |
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \ | |
-D CMAKE_FIND_FRAMEWORK=NEVER | |
cmake --build .deps | |
- name: Build neovim | |
run: | | |
cmake -B build -G Ninja \ | |
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \ | |
-D ENABLE_LIBINTL=OFF \ | |
-D CMAKE_FIND_FRAMEWORK=NEVER | |
cmake --build build | |
- name: Package | |
run: cpack --config build/CPackConfig.cmake | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: nvim-macos-${{ matrix.arch }} | |
path: build/nvim-macos-${{ matrix.arch }}.tar.gz | |
retention-days: 1 | |
windows: | |
needs: setup | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Perform a full checkout #13471 | |
fetch-depth: 0 | |
- run: .github/scripts/env.ps1 | |
- name: Build deps | |
run: | | |
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} | |
cmake --build .deps | |
- name: build package | |
run: | | |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} | |
cmake --build build --target package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: nvim-win64 | |
path: | | |
build/nvim-win64.msi | |
build/nvim-win64.zip | |
retention-days: 1 | |
publish: | |
needs: [linux, macos, windows] | |
runs-on: ubuntu-latest | |
env: | |
GH_REPO: ${{ github.repository }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
steps: | |
# Must perform checkout first, since it deletes the target directory | |
# before running, and would therefore delete the downloaded artifacts | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y gettext-base | |
- if: github.event_name == 'workflow_dispatch' | |
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV | |
- if: github.event_name == 'schedule' | |
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV | |
- if: github.event_name == 'push' | |
run: | | |
TAG_NAME=${{ github.ref }} | |
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV | |
- if: env.TAG_NAME == 'nightly' | |
run: | | |
(echo 'SUBJECT=Nvim development (prerelease) build'; | |
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV | |
gh release delete nightly --yes || true | |
git push origin :nightly || true | |
- if: env.TAG_NAME != 'nightly' | |
run: | | |
(echo 'SUBJECT=Nvim release build'; | |
echo 'PRERELEASE=') >> $GITHUB_ENV | |
gh release delete stable --yes || true | |
git push origin :stable || true | |
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the | |
# containing folder from the output. | |
- run: | | |
for i in nvim-*; do | |
( | |
cd $i || exit | |
sha256sum * >> $GITHUB_WORKSPACE/shasum.txt | |
) | |
done | |
- name: Publish release | |
env: | |
NVIM_VERSION: ${{ needs.linux.outputs.version }} | |
DEBUG: api | |
run: | | |
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md" | |
echo '```' >> "$RUNNER_TEMP/notes.md" | |
cat shasum.txt >> "$RUNNER_TEMP/notes.md" | |
echo '```' >> "$RUNNER_TEMP/notes.md" | |
if [ "$TAG_NAME" != "nightly" ]; then | |
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-win64/* shasum.txt | |
fi | |
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-win64/* shasum.txt |