mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
247 lines
10 KiB
YAML
247 lines
10 KiB
YAML
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:
|
|
linux:
|
|
runs-on: ubuntu-20.04
|
|
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="-DCI_BUILD=OFF -DCMAKE_INSTALL_PREFIX:PATH="
|
|
printf 'version<<END\n' >> $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
|
|
build/nvim-linux64.deb
|
|
retention-days: 1
|
|
|
|
appimage:
|
|
runs-on: ubuntu-20.04
|
|
container:
|
|
image: ubuntu:18.04
|
|
options: --privileged # Privileged mode is needed to load fuse module.
|
|
steps:
|
|
- 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"
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y build-essential cmake gettext locales ninja-build pkg-config unzip
|
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
run: CC=gcc-10 make appimage-latest
|
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
run: CC=gcc-10 make appimage-nightly
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: appimage
|
|
path: |
|
|
build/bin/nvim.appimage
|
|
build/bin/nvim.appimage.zsync
|
|
retention-days: 1
|
|
|
|
macOS:
|
|
runs-on: macos-11
|
|
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 universal binary
|
|
run: ./.github/scripts/build_universal_macos.sh
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: nvim-macos
|
|
path: build/nvim-macos.tar.gz
|
|
retention-days: 1
|
|
|
|
windows:
|
|
runs-on: windows-2019
|
|
name: windows (MSVC_64)
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set env
|
|
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
|
|
}
|
|
}
|
|
- name: Build deps
|
|
run: |
|
|
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
|
|
cmake --build .deps
|
|
- name: build package
|
|
run: |
|
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=OFF
|
|
cmake --build build --target package
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: nvim-win64
|
|
path: |
|
|
build/nvim-win64.msi
|
|
build/nvim-win64.zip
|
|
retention-days: 1
|
|
|
|
publish:
|
|
needs: [linux, appimage, 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@v3
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
- 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.
|
|
- name: Generate Linux64 SHA256 checksums
|
|
run: |
|
|
cd ./nvim-linux64
|
|
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
|
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
|
|
- 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
|
|
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
|
|
- name: Publish release
|
|
env:
|
|
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
|
DEBUG: api
|
|
run: |
|
|
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
|
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
|
if [ "$TAG_NAME" != "nightly" ]; then
|
|
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
|
fi
|
|
|
|
publish-winget:
|
|
needs: publish
|
|
runs-on: windows-latest
|
|
steps:
|
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
name: Publish stable
|
|
uses: vedantmgoyal2009/winget-releaser@v2
|
|
with:
|
|
identifier: Neovim.Neovim
|
|
release-tag: ${{ github.event.inputs.tag_name || github.ref_name }}
|
|
token: ${{ secrets.WINGET_TOKEN }}
|
|
- 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
|
|
Install-Module -Name 'Carbon.Windows.Installer' -Force
|
|
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion
|
|
"version=$VERSION" >> $env:GITHUB_OUTPUT
|
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
name: Publish nightly
|
|
uses: vedantmgoyal2009/winget-releaser@v2
|
|
with:
|
|
identifier: Neovim.Neovim.Nightly
|
|
version: ${{ steps.get-version.outputs.version }}
|
|
release-tag: nightly
|
|
token: ${{ secrets.WINGET_TOKEN }}
|