2020-12-05 09:50:29 -07:00
|
|
|
name: Release
|
2020-12-01 21:32:04 -07:00
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '5 5 * * *'
|
2020-12-05 09:47:03 -07:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag_name:
|
|
|
|
description: 'Tag name for release'
|
|
|
|
required: false
|
|
|
|
default: nightly
|
2020-12-05 09:48:07 -07:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v[0-9]+.[0-9]+.[0-9]+
|
2020-12-01 21:32:04 -07:00
|
|
|
|
2020-12-09 05:39:09 -07:00
|
|
|
# Build on the oldest supported images, so we have broader compatibility
|
2022-08-09 08:35:19 -07:00
|
|
|
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
|
2020-12-01 21:32:04 -07:00
|
|
|
jobs:
|
|
|
|
linux:
|
2022-08-09 08:05:56 -07:00
|
|
|
runs-on: ubuntu-20.04
|
2020-12-01 21:32:04 -07:00
|
|
|
outputs:
|
|
|
|
version: ${{ steps.build.outputs.version }}
|
|
|
|
release: ${{ steps.build.outputs.release }}
|
|
|
|
steps:
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-06 15:00:27 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-12-01 21:32:04 -07:00
|
|
|
- name: Install dependencies
|
2023-02-17 16:09:51 -07:00
|
|
|
run: ./.github/scripts/install_deps.sh
|
2021-08-13 17:08:46 -07:00
|
|
|
- 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
|
2020-12-05 10:28:56 -07:00
|
|
|
- name: Build release
|
2020-12-01 21:32:04 -07:00
|
|
|
id: build
|
|
|
|
run: |
|
2023-02-18 09:43:39 -07:00
|
|
|
CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCI_BUILD=OFF -DCMAKE_INSTALL_PREFIX:PATH="
|
2022-12-28 04:48:19 -07:00
|
|
|
printf 'version<<END\n' >> $GITHUB_OUTPUT
|
|
|
|
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
|
|
|
|
printf 'END\n' >> $GITHUB_OUTPUT
|
2022-11-05 15:22:39 -07:00
|
|
|
printf 'release=%s\n' "$(./build/bin/nvim --version | head -n 1)" >> $GITHUB_OUTPUT
|
2020-12-05 10:28:56 -07:00
|
|
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
2022-02-07 13:49:09 -07:00
|
|
|
cd "$GITHUB_WORKSPACE/build/"
|
|
|
|
cpack -C $NVIM_BUILD_TYPE
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-12-01 21:32:04 -07:00
|
|
|
with:
|
2020-12-05 06:52:50 -07:00
|
|
|
name: nvim-linux64
|
2022-06-28 03:40:53 -07:00
|
|
|
path: |
|
|
|
|
build/nvim-linux64.tar.gz
|
|
|
|
build/nvim-linux64.deb
|
2020-12-01 21:32:04 -07:00
|
|
|
retention-days: 1
|
|
|
|
|
2020-12-04 18:55:31 -07:00
|
|
|
appimage:
|
2022-08-09 08:05:56 -07:00
|
|
|
runs-on: ubuntu-20.04
|
2022-10-07 05:56:31 -07:00
|
|
|
container:
|
|
|
|
image: ubuntu:18.04
|
|
|
|
options: --privileged # Privileged mode is needed to load fuse module.
|
2020-12-04 18:55:31 -07:00
|
|
|
steps:
|
2022-10-07 05:56:31 -07:00
|
|
|
- name: Prepare container
|
|
|
|
run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y software-properties-common
|
|
|
|
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
|
|
|
|
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y git gcc-10
|
|
|
|
apt-get install -y fuse libfuse2 # For linuxdeploy.
|
|
|
|
# Workaround for https://github.com/actions/checkout/issues/766.
|
|
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-06 15:00:27 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-12-04 18:55:31 -07:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-10-07 05:56:31 -07:00
|
|
|
apt-get update
|
2023-02-17 16:09:51 -07:00
|
|
|
apt-get install -y build-essential cmake gettext locales ninja-build pkg-config unzip
|
2020-12-05 10:28:56 -07:00
|
|
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
2022-08-09 08:35:19 -07:00
|
|
|
run: CC=gcc-10 make appimage-latest
|
2020-12-06 07:00:47 -07:00
|
|
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
2022-08-09 08:35:19 -07:00
|
|
|
run: CC=gcc-10 make appimage-nightly
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-12-04 18:55:31 -07:00
|
|
|
with:
|
2020-12-05 06:52:50 -07:00
|
|
|
name: appimage
|
2022-06-28 03:40:53 -07:00
|
|
|
path: |
|
|
|
|
build/bin/nvim.appimage
|
|
|
|
build/bin/nvim.appimage.zsync
|
2020-12-04 18:55:31 -07:00
|
|
|
retention-days: 1
|
|
|
|
|
2020-12-01 21:32:04 -07:00
|
|
|
macOS:
|
ci(release): build a universal binary on macOS
After some tweaks to our dep builds, we can now build a universal binary
for macOS by using `CMAKE_OSX_ARCHITECTURES`. So, let's do that. This
requires a number of additional changes:
1. We need to build on macOS 11, since earlier versions do not support
building universal (M1 + Intel) binaries.
2. We need to provision a universal `libintl`. The linker will look for
an ARM64 version of this library when linking the `nvim` binary.
While we're here:
1. Link statically to `libintl`. This allows to to avoid having to do
any install name rewriting or codesigning to package Neovim.
2. Bump the `MACOSX_DEPLOYMENT_TARGET` to `11`. We're already using a
`libintl` built by Homebrew (through the pre-installed version of
`gettext`), and that is built for macOS 11.
In order to ensure we link to `libintl.a` instead of `libintl.dylib`, we
have to make sure that CMake can't find the latter. This ideally should
be a matter of doing `brew unlink gettext`. However, CMake is too adept
at finding things that Homebrew has installed (even when not linked), so
we have to do a bit more than that. This appears in the additional step
ensuring static linkage to `libintl`.
We end up breaking some Homebrew-installed software in the process, and
some of these software is called during our build (e.g. curl, git,
wget). To avoid any adverse effects, let's just uninstall them.
2022-06-24 08:48:17 -07:00
|
|
|
runs-on: macos-11
|
2020-12-01 21:32:04 -07:00
|
|
|
steps:
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-06 15:00:27 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-02-17 16:09:51 -07:00
|
|
|
- name: Install dependencies
|
|
|
|
run: ./.github/scripts/install_deps.sh
|
2021-08-13 17:08:46 -07:00
|
|
|
- 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
|
2023-02-07 15:09:08 -07:00
|
|
|
- name: Build universal binary
|
|
|
|
run: ./.github/scripts/build_universal_macos.sh
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-12-01 21:32:04 -07:00
|
|
|
with:
|
2020-12-05 06:52:50 -07:00
|
|
|
name: nvim-macos
|
2022-07-22 07:08:11 -07:00
|
|
|
path: build/nvim-macos.tar.gz
|
2020-12-01 21:32:04 -07:00
|
|
|
retention-days: 1
|
|
|
|
|
2020-12-30 21:16:32 -07:00
|
|
|
windows:
|
2021-10-23 18:38:58 -07:00
|
|
|
runs-on: windows-2019
|
2022-09-30 07:39:57 -07:00
|
|
|
name: windows (MSVC_64)
|
2020-12-30 21:16:32 -07:00
|
|
|
steps:
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-30 21:16:32 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-11-05 14:57:11 -07:00
|
|
|
- name: Set env
|
2023-02-12 10:08:37 -07:00
|
|
|
run: |
|
|
|
|
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
|
|
|
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
|
|
|
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
|
|
|
|
$name, $value = $_ -split '=', 2
|
|
|
|
"$name=$value" >> $env:GITHUB_ENV
|
|
|
|
}
|
|
|
|
}
|
2022-07-18 06:18:15 -07:00
|
|
|
- name: Build deps
|
2022-11-05 14:57:11 -07:00
|
|
|
run: |
|
2023-02-12 10:08:37 -07:00
|
|
|
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
|
|
|
|
cmake --build .deps
|
2022-07-18 06:18:15 -07:00
|
|
|
- name: build package
|
2022-11-05 14:57:11 -07:00
|
|
|
run: |
|
2023-02-18 09:43:39 -07:00
|
|
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=OFF
|
2022-11-05 14:57:11 -07:00
|
|
|
cmake --build build --target package
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-12-30 21:16:32 -07:00
|
|
|
with:
|
2022-09-30 07:39:57 -07:00
|
|
|
name: nvim-win64
|
2022-06-28 03:40:53 -07:00
|
|
|
path: |
|
2022-09-30 07:39:57 -07:00
|
|
|
build/nvim-win64.msi
|
|
|
|
build/nvim-win64.zip
|
2022-02-07 13:49:09 -07:00
|
|
|
retention-days: 1
|
2020-12-30 21:16:32 -07:00
|
|
|
|
2020-12-01 21:32:04 -07:00
|
|
|
publish:
|
2020-12-30 21:16:32 -07:00
|
|
|
needs: [linux, appimage, macOS, windows]
|
2022-08-09 08:05:56 -07:00
|
|
|
runs-on: ubuntu-latest
|
2021-10-17 19:55:46 -07:00
|
|
|
env:
|
|
|
|
GH_REPO: ${{ github.repository }}
|
2022-06-28 03:40:53 -07:00
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-20 21:32:38 -07:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2020-12-01 21:32:04 -07:00
|
|
|
steps:
|
2021-10-17 19:55:46 -07:00
|
|
|
# Must perform checkout first, since it deletes the target directory
|
|
|
|
# before running, and would therefore delete the downloaded artifacts
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/checkout@v3
|
2021-10-17 19:55:46 -07:00
|
|
|
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/download-artifact@v3
|
2021-10-17 19:55:46 -07:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-06-28 03:40:53 -07:00
|
|
|
run: sudo apt-get update && sudo apt-get install -y gettext-base
|
2021-10-17 19:55:46 -07:00
|
|
|
|
2020-12-05 09:47:03 -07:00
|
|
|
- if: github.event_name == 'workflow_dispatch'
|
|
|
|
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
2020-12-06 07:00:47 -07:00
|
|
|
- if: github.event_name == 'schedule'
|
2020-12-05 09:47:03 -07:00
|
|
|
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV
|
2020-12-05 09:48:07 -07:00
|
|
|
- if: github.event_name == 'push'
|
|
|
|
run: |
|
|
|
|
TAG_NAME=${{ github.ref }}
|
|
|
|
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
2020-12-05 09:47:03 -07:00
|
|
|
- if: env.TAG_NAME == 'nightly'
|
2021-10-17 19:55:46 -07:00
|
|
|
run: |
|
|
|
|
(echo 'SUBJECT=Nvim development (prerelease) build';
|
|
|
|
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
|
2021-10-17 21:04:58 -07:00
|
|
|
gh release delete nightly --yes || true
|
2021-11-02 04:25:22 -07:00
|
|
|
git push origin :nightly || true
|
2020-12-05 09:47:03 -07:00
|
|
|
- if: env.TAG_NAME != 'nightly'
|
2021-10-17 19:55:46 -07:00
|
|
|
run: |
|
|
|
|
(echo 'SUBJECT=Nvim release build';
|
|
|
|
echo 'PRERELEASE=') >> $GITHUB_ENV
|
2021-10-17 21:04:58 -07:00
|
|
|
gh release delete stable --yes || true
|
2021-11-02 04:25:22 -07:00
|
|
|
git push origin :stable || true
|
2021-07-01 09:33:51 -07:00
|
|
|
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
|
|
|
|
# containing folder from the output.
|
|
|
|
- name: Generate Linux64 SHA256 checksums
|
|
|
|
run: |
|
|
|
|
cd ./nvim-linux64
|
|
|
|
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
2022-02-07 13:49:09 -07:00
|
|
|
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
|
|
|
sha256sum nvim-linux64.deb > nvim-linux64.deb.sha256sum
|
|
|
|
echo "SHA_LINUX_64_DEB=$(cat nvim-linux64.deb.sha256sum)" >> $GITHUB_ENV
|
2021-07-01 09:33:51 -07:00
|
|
|
- name: Generate App Image SHA256 checksums
|
|
|
|
run: |
|
|
|
|
cd ./appimage
|
|
|
|
sha256sum nvim.appimage > nvim.appimage.sha256sum
|
|
|
|
echo "SHA_APP_IMAGE=$(cat nvim.appimage.sha256sum)" >> $GITHUB_ENV
|
|
|
|
- name: Generate App Image Zsync SHA256 checksums
|
|
|
|
run: |
|
|
|
|
cd ./appimage
|
|
|
|
sha256sum nvim.appimage.zsync > nvim.appimage.zsync.sha256sum
|
|
|
|
echo "SHA_APP_IMAGE_ZSYNC=$(cat nvim.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
|
|
|
- name: Generate macOS SHA256 checksums
|
|
|
|
run: |
|
|
|
|
cd ./nvim-macos
|
|
|
|
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
|
|
|
|
echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV
|
|
|
|
- name: Generate Win64 SHA256 checksums
|
|
|
|
run: |
|
|
|
|
cd ./nvim-win64
|
|
|
|
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
|
2022-02-07 13:49:09 -07:00
|
|
|
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
|
|
|
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
|
|
|
|
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
2021-10-17 19:55:46 -07:00
|
|
|
- name: Publish release
|
|
|
|
env:
|
|
|
|
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
2022-01-12 05:11:47 -07:00
|
|
|
DEBUG: api
|
2021-10-17 19:55:46 -07:00
|
|
|
run: |
|
|
|
|
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
2021-11-06 12:38:46 -07:00
|
|
|
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
2021-10-17 20:39:00 -07:00
|
|
|
if [ "$TAG_NAME" != "nightly" ]; then
|
2021-11-06 12:38:46 -07:00
|
|
|
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
2021-10-17 20:39:00 -07:00
|
|
|
fi
|
2022-11-05 15:22:39 -07:00
|
|
|
|
2022-08-13 06:34:28 -07:00
|
|
|
publish-winget:
|
2022-09-19 01:48:05 -07:00
|
|
|
needs: publish
|
|
|
|
runs-on: windows-latest
|
2022-08-13 06:34:28 -07:00
|
|
|
steps:
|
2022-09-16 15:33:06 -07:00
|
|
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
|
|
name: Publish stable
|
2023-02-20 13:23:08 -07:00
|
|
|
uses: vedantmgoyal2009/winget-releaser@v2
|
2022-08-13 06:34:28 -07:00
|
|
|
with:
|
|
|
|
identifier: Neovim.Neovim
|
2022-10-01 10:13:44 -07:00
|
|
|
release-tag: ${{ github.event.inputs.tag_name || github.ref_name }}
|
2022-08-13 06:34:28 -07:00
|
|
|
token: ${{ secrets.WINGET_TOKEN }}
|
2022-09-16 15:33:06 -07:00
|
|
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
|
|
name: Get nightly version
|
|
|
|
id: get-version
|
|
|
|
run: |
|
|
|
|
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi
|
2022-09-19 01:48:05 -07:00
|
|
|
Install-Module -Name 'Carbon.Windows.Installer' -Force
|
|
|
|
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion
|
2022-11-17 01:43:45 -07:00
|
|
|
"version=$VERSION" >> $env:GITHUB_OUTPUT
|
2022-09-16 15:33:06 -07:00
|
|
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
|
|
name: Publish nightly
|
2023-02-20 13:23:08 -07:00
|
|
|
uses: vedantmgoyal2009/winget-releaser@v2
|
2022-09-16 15:33:06 -07:00
|
|
|
with:
|
|
|
|
identifier: Neovim.Neovim.Nightly
|
|
|
|
version: ${{ steps.get-version.outputs.version }}
|
|
|
|
release-tag: nightly
|
|
|
|
token: ${{ secrets.WINGET_TOKEN }}
|