2023-11-12 13:40:24 -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
|
2023-04-22 13:58:14 -07:00
|
|
|
env:
|
|
|
|
CC: gcc-10
|
2020-12-01 21:32:04 -07:00
|
|
|
outputs:
|
|
|
|
version: ${{ steps.build.outputs.version }}
|
2020-12-04 18:55:31 -07:00
|
|
|
steps:
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-30 06:03:25 -07:00
|
|
|
with:
|
|
|
|
# Perform a full checkout #13471
|
|
|
|
fetch-depth: 0
|
2023-09-09 01:36:42 -07:00
|
|
|
- run: ./.github/scripts/install_deps.sh
|
2020-12-05 10:28:56 -07:00
|
|
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
2023-04-22 13:58:14 -07:00
|
|
|
run: |
|
2024-01-27 11:10:41 -07:00
|
|
|
echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV
|
2023-04-22 13:58:14 -07:00
|
|
|
echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV
|
2020-12-06 07:00:47 -07:00
|
|
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
2023-04-22 13:58:14 -07:00
|
|
|
run: |
|
2024-01-27 11:10:41 -07:00
|
|
|
echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV
|
2023-04-22 13:58:14 -07:00
|
|
|
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV
|
|
|
|
- name: appimage
|
|
|
|
run: ./scripts/genappimage.sh ${APPIMAGE_TAG}
|
|
|
|
- name: tar.gz
|
|
|
|
run: cpack --config build/CPackConfig.cmake -G TGZ
|
2023-12-15 05:53:14 -07:00
|
|
|
- uses: actions/upload-artifact@v4
|
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
|
2023-12-15 05:53:14 -07:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-04-22 13:58:14 -07:00
|
|
|
with:
|
|
|
|
name: nvim-linux64
|
|
|
|
path: |
|
|
|
|
build/nvim-linux64.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
|
2020-12-04 18:55:31 -07:00
|
|
|
|
2020-12-01 21:32:04 -07:00
|
|
|
macOS:
|
2024-02-17 05:35:47 -07:00
|
|
|
runs-on: macos-14
|
2020-12-01 21:32:04 -07:00
|
|
|
steps:
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-30 06:03:25 -07:00
|
|
|
with:
|
|
|
|
# Perform a full checkout #13471
|
|
|
|
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')
|
2024-01-27 11:10:41 -07:00
|
|
|
run: printf 'CMAKE_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
2021-08-13 17:08:46 -07:00
|
|
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
2024-01-27 11:10:41 -07:00
|
|
|
run: printf 'CMAKE_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
|
2023-12-15 05:53:14 -07:00
|
|
|
- uses: actions/upload-artifact@v4
|
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:
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-30 06:03:25 -07:00
|
|
|
with:
|
|
|
|
# Perform a full checkout #13471
|
|
|
|
fetch-depth: 0
|
2023-04-23 07:35:49 -07:00
|
|
|
- run: .github/scripts/env.ps1
|
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-04-07 13:31:04 -07:00
|
|
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
|
2022-11-05 14:57:11 -07:00
|
|
|
cmake --build build --target package
|
2023-12-15 05:53:14 -07:00
|
|
|
- uses: actions/upload-artifact@v4
|
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:
|
2023-04-22 13:58:14 -07:00
|
|
|
needs: [linux, 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
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2021-10-17 19:55:46 -07:00
|
|
|
|
2023-12-15 05:51:51 -07:00
|
|
|
- uses: actions/download-artifact@v4
|
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
|
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-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
|
2023-12-20 06:53:30 -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/*
|