Only send lsp status updates when the lsp status changes (#263) #172
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
on: | |
push: | |
tags: | |
- 'v*' # "v1.2.3" | |
branches: | |
- master | |
paths-ignore: ['media/**', 'docs/**', '**/*.md'] | |
pull_request: | |
paths-ignore: ['media/**', 'docs/**', '**/*.md'] | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: true | |
matrix: | |
target: | |
- os: linux | |
triple: x86_64-linux-musl | |
name: linux | |
cpu: amd64 | |
nim_cpu: amd64 | |
nimble_cpu: amd64 | |
archive_format: tgz | |
- os: linux | |
triple: i686-linux-musl | |
name: linux | |
cpu: i686 | |
nim_cpu: i386 | |
nimble_cpu: amd64 | |
archive_format: tgz | |
- os: linux | |
triple: aarch64-linux-musl | |
name: linux | |
cpu: arm64 | |
nim_cpu: arm64 | |
nimble_cpu: amd64 | |
archive_format: tgz | |
- os: macos | |
triple: x86_64-apple-darwin14 | |
name: macos | |
cpu: amd64 | |
nim_cpu: amd64 | |
nimble_cpu: amd64 | |
archive_format: zip | |
- os: macos | |
triple: aarch64-apple-darwin14 | |
name: macos | |
cpu: arm64 | |
nim_cpu: arm64 | |
nimble_cpu: amd64 | |
archive_format: zip | |
- os: windows | |
triple: x86_64-w64-mingw32 | |
name: windows | |
cpu: amd64 | |
nim_cpu: amd64 | |
nimble_cpu: amd64 | |
archive_format: zip | |
- os: windows | |
triple: i686-w32-mingw32 | |
name: windows | |
cpu: i686 | |
nim_cpu: i386 | |
nimble_cpu: amd64 | |
archive_format: zip | |
include: | |
- target: | |
os: linux | |
builder: ubuntu-20.04 | |
- target: | |
os: macos | |
builder: macos-12 | |
- target: | |
os: windows | |
builder: windows-2019 | |
defaults: | |
run: | |
shell: bash | |
name: '${{ matrix.target.triple }}' | |
runs-on: ${{ matrix.builder }} | |
steps: | |
- name: Setup Build | |
if: matrix.builder == 'ubuntu-20.04' | |
run: | | |
sudo apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu \ | |
gcc-i686-linux-gnu binutils-i686-linux-gnu \ | |
mingw-w64 | |
- name: Setup mingw32 | |
if: matrix.target.triple == 'i686-w32-mingw32' | |
run: | | |
curl -LSsO https://github.com/brechtsanders/winlibs_mingw/releases/download/11.1.0-12.0.0-8.0.2-r1/winlibs-i686-posix-dwarf-gcc-11.1.0-mingw-w64-8.0.2-r1.7z | |
echo "588794e11be36389501610cf78de777e52a920e03db256ee8bd1a7c2c45e39a4 winlibs-i686-posix-dwarf-gcc-11.1.0-mingw-w64-8.0.2-r1.7z" | sha256sum -c | |
7z x winlibs-i686-posix-dwarf-gcc-11.1.0-mingw-w64-8.0.2-r1.7z C:\\ | |
echo "C:\\mingw32\\bin" >> $GITHUB_PATH | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Nimble | |
uses: nim-lang/nimble/.github/actions/install_nimble@master | |
with: | |
os: ${{ matrix.target.name }} | |
cpu: ${{ matrix.target.nimble_cpu }} | |
- name: Restore nimble dependencies from cache | |
id: nimble_deps | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nimble/ | |
key: ${{ matrix.target.os }}-${{ env.cache_nonce }} | |
- name: build nimlangserver | |
run: | | |
echo i386.linux.gcc.exe = \"i686-linux-gnu-gcc\" >> nimlangserver.nim.cfg | |
echo i386.linux.gcc.linkerexe = \"i686-linux-gnu-gcc\" >> nimlangserver.nim.cfg | |
echo i386.windows.gcc.exe = \"i686-w64-mingw32-gcc.exe\" >> nimlangserver.nim.cfg | |
echo i386.windows.gcc.linkerexe = \"i686-w64-mingw32-gcc.exe\" >> nimlangserver.nim.cfg | |
if [ ${{ matrix.target.triple }} = 'aarch64-apple-darwin14' ]; then | |
echo "--passC:\"-target arm64-apple-macos11\"" >> nimlangserver.nim.cfg | |
echo "--passL:\"-target arm64-apple-macos11\"" >> nimlangserver.nim.cfg | |
cat nimlangserver.nim.cfg | |
nimble build -d:release --cpu:arm64 --os:macosx | |
else | |
nimble build -d:release --cpu:${{ matrix.target.nim_cpu }} | |
fi | |
- name: Compress the Nim Language Server binaries | |
run: | | |
if [ ${{matrix.target.name}} = 'windows' ]; then | |
EXEEXT=.exe | |
else | |
EXEEXT= | |
fi | |
if [ ${{ matrix.target.archive_format }} = 'zip' ]; then | |
7z a -tzip nimlangserver-${{ matrix.target.name }}-${{ matrix.target.cpu }}.zip nimlangserver${EXEEXT} | |
else | |
tar -czvf nimlangserver-${{ matrix.target.name }}-${{ matrix.target.cpu }}.tar.gz nimlangserver${EXEEXT} | |
fi | |
- name: Upload the Nim Language Server Binaries (.zip) | |
if: matrix.target.archive_format == 'zip' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nimlangserver-${{ matrix.target.name }}-${{ matrix.target.cpu }}.zip | |
path: nimlangserver-${{ matrix.target.name }}-${{ matrix.target.cpu }}.zip | |
- name: Upload the Nim Language Server Binaries (.tar.gz) | |
if: matrix.target.archive_format == 'tgz' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nimlangserver-${{ matrix.target.name }}-${{ matrix.target.cpu }}.tar.gz | |
path: nimlangserver-${{ matrix.target.name }}-${{ matrix.target.cpu }}.tar.gz | |
create-macos-universal-binary: | |
name: Create a Universal macOS binary | |
needs: [build] | |
runs-on: macos-12 | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: nimlangserver-macos-*.zip | |
- name: Extract binaries for amd64-macos | |
shell: bash | |
run: | | |
7z x nimlangserver-macos-amd64.zip/nimlangserver-macos-amd64.zip | |
mv nimlangserver nimlangserver-amd64 | |
- name: Extract binaries for arm64-macos | |
shell: bash | |
run: | | |
7z x nimlangserver-macos-arm64.zip/nimlangserver-macos-arm64.zip | |
mv nimlangserver nimlangserver-arm64 | |
- name: Build Universal binary | |
shell: bash | |
run: | | |
lipo -create -output nimlangserver nimlangserver-amd64 nimlangserver-arm64 | |
- name: Compress the Nim Language Server binaries | |
shell: bash | |
run: | | |
7z a -tzip nimlangserver-macos-universal.zip nimlangserver | |
- name: Upload the Nim Language Server Binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nimlangserver-macos-universal.zip | |
path: nimlangserver-macos-universal.zip | |
create-github-release: | |
name: Create Github Release | |
needs: [build, create-macos-universal-binary] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: write | |
steps: | |
- name: Download artefacts | |
uses: actions/download-artifact@v4 | |
- uses: ncipollo/release-action@v1 | |
with: | |
name: Latest Nimlangserver Binaries | |
artifacts: "*/*" | |
allowUpdates: true | |
makeLatest: true | |
prerelease: true | |
tag: latest | |
- name: Delete artefacts | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
failOnError: false | |
name: "nimlangserver-*" |