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
|
2021-06-13 00:21:29 -07:00
|
|
|
# Upgrade to gcc-11 to prevent it from using its builtins (#14150)
|
2020-12-01 21:32:04 -07:00
|
|
|
jobs:
|
|
|
|
linux:
|
2021-05-02 13:27:27 -07:00
|
|
|
runs-on: ubuntu-18.04
|
2020-12-01 21:32:04 -07:00
|
|
|
outputs:
|
|
|
|
version: ${{ steps.build.outputs.version }}
|
|
|
|
release: ${{ steps.build.outputs.release }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-12-06 15:00:27 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-12-01 21:32:04 -07:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2021-06-13 00:21:29 -07:00
|
|
|
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
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: |
|
2021-08-13 17:08:46 -07:00
|
|
|
CC=gcc-11 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
|
2020-12-01 21:32:04 -07:00
|
|
|
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
2020-12-06 07:50:02 -07:00
|
|
|
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
2020-12-05 10:28:56 -07:00
|
|
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
|
|
|
cd "$GITHUB_WORKSPACE/build/release"
|
2020-12-01 21:32:04 -07:00
|
|
|
tar cfz nvim-linux64.tar.gz nvim-linux64
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-12-05 06:52:50 -07:00
|
|
|
name: nvim-linux64
|
2020-12-05 10:28:56 -07:00
|
|
|
path: build/release/nvim-linux64.tar.gz
|
2020-12-01 21:32:04 -07:00
|
|
|
retention-days: 1
|
|
|
|
|
2020-12-04 18:55:31 -07:00
|
|
|
appimage:
|
2021-05-02 13:27:27 -07:00
|
|
|
runs-on: ubuntu-18.04
|
2020-12-04 18:55:31 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-12-06 15:00:27 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-12-04 18:55:31 -07:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2021-06-13 00:21:29 -07:00
|
|
|
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin 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')
|
2021-06-13 00:21:29 -07:00
|
|
|
run: CC=gcc-11 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')
|
2021-06-13 00:21:29 -07:00
|
|
|
run: CC=gcc-11 make appimage-nightly
|
2020-12-04 18:55:31 -07:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-12-05 06:52:50 -07:00
|
|
|
name: appimage
|
2020-12-04 18:55:31 -07:00
|
|
|
path: build/bin/nvim.appimage
|
|
|
|
retention-days: 1
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-12-05 06:52:50 -07:00
|
|
|
name: appimage
|
2020-12-04 18:55:31 -07:00
|
|
|
path: build/bin/nvim.appimage.zsync
|
|
|
|
retention-days: 1
|
|
|
|
|
2020-12-01 21:32:04 -07:00
|
|
|
macOS:
|
2020-12-11 11:07:07 -07:00
|
|
|
runs-on: macos-10.15
|
2020-12-01 21:32:04 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-12-06 15:00:27 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-12-01 21:32:04 -07:00
|
|
|
- name: Install brew packages
|
|
|
|
run: |
|
|
|
|
brew update >/dev/null
|
|
|
|
brew install automake ninja
|
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
|
|
|
run: |
|
2021-08-13 17:08:46 -07:00
|
|
|
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
|
2020-12-05 10:28:56 -07:00
|
|
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-osx64" install
|
2020-12-01 21:32:04 -07:00
|
|
|
- name: Create package
|
|
|
|
run: |
|
2020-12-05 10:28:56 -07:00
|
|
|
cd "$GITHUB_WORKSPACE/build/release"
|
2020-12-06 14:26:31 -07:00
|
|
|
mkdir -p nvim-osx64/libs
|
2020-12-01 21:32:04 -07:00
|
|
|
libs=($(otool -L nvim-osx64/bin/nvim | sed 1d | sed -E -e 's|^[[:space:]]*||' -e 's| .*||'))
|
|
|
|
echo "libs:"
|
|
|
|
for lib in "${libs[@]}"; do
|
|
|
|
if echo "$lib" | grep -q -E 'libSystem|CoreFoundation' 2>/dev/null; then
|
|
|
|
echo " [skipped] $lib"
|
|
|
|
else
|
|
|
|
echo " $lib"
|
|
|
|
relname="libs/${lib##*/}"
|
2020-12-06 14:26:31 -07:00
|
|
|
cp -L "$lib" "nvim-osx64/$relname"
|
|
|
|
install_name_tool -change "$lib" "@executable_path/../$relname" nvim-osx64/bin/nvim
|
2020-12-01 21:32:04 -07:00
|
|
|
fi
|
|
|
|
done
|
2020-12-06 14:26:31 -07:00
|
|
|
tar cfz nvim-macos.tar.gz nvim-osx64
|
2020-12-01 21:32:04 -07:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-12-05 06:52:50 -07:00
|
|
|
name: nvim-macos
|
2020-12-06 14:26:31 -07:00
|
|
|
path: build/release/nvim-macos.tar.gz
|
2020-12-01 21:32:04 -07:00
|
|
|
retention-days: 1
|
|
|
|
|
2020-12-30 21:16:32 -07:00
|
|
|
windows:
|
|
|
|
runs-on: windows-2016
|
|
|
|
env:
|
2021-04-20 19:57:41 -07:00
|
|
|
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
|
|
|
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
2020-12-30 21:16:32 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- config: MSVC_64
|
|
|
|
archive: nvim-win64
|
|
|
|
name: windows (${{ matrix.config }})
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- run: powershell ci\build.ps1 -NoTests
|
|
|
|
env:
|
|
|
|
CONFIGURATION: ${{ matrix.config }}
|
|
|
|
- run: move build\Neovim.zip build\${{ matrix.archive }}.zip
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.archive }}
|
|
|
|
path: build/${{ matrix.archive }}.zip
|
|
|
|
retention-days: 1
|
|
|
|
|
2020-12-01 21:32:04 -07:00
|
|
|
publish:
|
2020-12-30 21:16:32 -07:00
|
|
|
needs: [linux, appimage, macOS, windows]
|
2020-12-01 21:32:04 -07:00
|
|
|
runs-on: ubuntu-20.04
|
2021-10-17 19:55:46 -07:00
|
|
|
env:
|
|
|
|
GH_REPO: ${{ github.repository }}
|
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
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2020-12-01 21:32:04 -07:00
|
|
|
- uses: actions/download-artifact@v2
|
2021-10-17 19:55:46 -07:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y gettext-base
|
|
|
|
|
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 20:39:00 -07:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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 20:39:00 -07:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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
|
|
|
|
echo "SHA_LINUX_64=$(cat nvim-linux64.tar.gz.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=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
2021-10-17 19:55:46 -07:00
|
|
|
- name: Publish release
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
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
|