diff options
-rw-r--r-- | .github/workflows/build.yml | 114 | ||||
-rw-r--r-- | .github/workflows/release.yml | 168 | ||||
m--------- | 3rd/EmmyLuaCodeStyle | 0 | ||||
-rw-r--r-- | script/cli/check.lua | 1 | ||||
-rw-r--r-- | script/plugin.lua | 1 |
5 files changed, 106 insertions, 178 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c503a25..66640e50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,8 @@ on: push: branches: - master + tags: + - "*" pull_request: branches: - master @@ -21,36 +23,71 @@ jobs: fail-fast: false matrix: include: - - { os: ubuntu-20.04, target: linux, platform: linux-x64 } - - { os: ubuntu-20.04, target: linux, platform: linux-arm64 } + - { os: ubuntu-22.04, target: linux, platform: linux-x64, container: 'alpine:latest', libc: musl } + - { os: ubuntu-20.04, target: linux, platform: linux-x64, container: 'ubuntu:18.04' } + - { os: ubuntu-20.04, target: linux, platform: linux-arm64, container: 'ubuntu:18.04' } - { os: macos-11, target: darwin, platform: darwin-x64 } - { os: macos-11, target: darwin, platform: darwin-arm64 } - { os: windows-latest, target: windows, platform: win32-ia32 } - { os: windows-latest, target: windows, platform: win32-x64 } runs-on: ${{ matrix.os }} + container: + image: ${{ matrix.container }} steps: - - uses: actions/checkout@v3 - with: - submodules: recursive + - name: Prepare container + if: ${{ matrix.target == 'linux' && matrix.libc != 'musl' }} + run: | + apt-get update + apt-get install -y software-properties-common + add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-9 and g++-9 + add-apt-repository -y ppa:git-core/ppa # For git>=2.18. + apt-get update + apt-get install -y sudo git gcc-9 g++-9 - - name: Prepare Linux-ARM64 - if: ${{ matrix.platform == 'linux-arm64' }} + - name: Install aarch64-linux-gnu + if: ${{ matrix.platform == 'linux-arm64' && matrix.libc != 'musl' }} run: | apt-get update apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - - name: Install Luamake + - name: Prepare container env + if: ${{ matrix.target == 'linux' && matrix.libc != 'musl' }} + run: | + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100 + + - name: Prepare container for musl + if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }} + run: | + apk update + apk add git ninja bash build-base nodejs linux-headers + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Build for others step-1 + if: ${{ matrix.libc != 'musl' }} uses: actboy168/setup-luamake@master - - name: Luamake + - name: Build for others step-2 + if: ${{ matrix.libc != 'musl' }} run: luamake -platform ${{ matrix.platform }} + - name: Build for musl + if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }} + run: ./make.sh + - name: Setting up workflow variables id: vars shell: bash run: | # Package version - PKG_VERSION=${GITHUB_SHA:0:7} + if [[ $GITHUB_REF = refs/tags/* ]]; then + PKG_VERSION=${GITHUB_REF##*/} + else + PKG_VERSION=${GITHUB_SHA:0:7} + fi # Package suffix relative to the platform if [[ "${{ matrix.target }}" = windows ]]; then @@ -61,8 +98,21 @@ jobs: # Package name w/ version PKG_BASENAME="${{ env.PROJECT }}-${PKG_VERSION}-${{ matrix.platform }}" + if [[ "${{ matrix.libc }}" = musl ]]; then + PKG_BASENAME="${PKG_BASENAME}-${{matrix.libc}}" + fi + # Full name of the tarball asset + PKG_NAME="${PKG_BASENAME}.${PKG_SUFFIX}" + + # Staging area for tarballs + PKG_STAGING="ci_staging/$PKG_BASENAME" + + echo PKG_VERSION=${PKG_VERSION} >> $GITHUB_OUTPUT echo PKG_BASENAME=${PKG_BASENAME} >> $GITHUB_OUTPUT + echo PKG_NAME=${PKG_NAME} >> $GITHUB_OUTPUT + echo PKG_PATH="${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT + echo PKG_STAGING=${PKG_STAGING} >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 with: @@ -77,3 +127,47 @@ jobs: doc meta script + + - name: Package tarballs + if: startsWith(github.ref, 'refs/tags/') + shell: bash + run: | + STAGING=${{ steps.vars.outputs.PKG_STAGING }} + NAME=${{ steps.vars.outputs.PKG_NAME }} + + # Making the staging area + mkdir -p ${STAGING} + + # Copying binary and runtime files to staging area + cp -r main.lua debugger.lua LICENSE changelog.md locale meta script ${{ env.BIN_DIR }} ${STAGING} + + # Creating release assets + pushd "${STAGING}/" >/dev/null + if [[ "${{ matrix.target }}" = windows ]]; then + 7z -y a ${NAME} * | tail -2 + else + tar czf ${NAME} * + fi + popd >/dev/null + + # Packaging submodules for homebrew distribution + - name: Package submodules + id: submodules + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.platform == 'darwin-x64' }} + run: | + STAGING=${{ steps.vars.outputs.PKG_STAGING }} + PKG_SUBMOD_NAME="${{ env.PROJECT }}-${{ steps.vars.outputs.PKG_VERSION }}-submodules.zip" + PKG_SUBMOD_PATH="${STAGING}/$PKG_SUBMOD_NAME" + + zip -r $PKG_SUBMOD_PATH ./ -x "*.git*" -x "*.vscode*" -x "build*" -x "${{ env.BIN_DIR }}*" -x "${STAGING}*" -x "3rd/json.lua*" -x "log*" -x "ci_staging*" + + echo PKG_SUBMOD_PATH=${PKG_SUBMOD_PATH} >> $GITHUB_OUTPUT + + - name: Publish release assets + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + generate_release_notes: true + files: | + ${{ steps.vars.outputs.PKG_PATH }} + ${{ steps.submodules.outputs.PKG_SUBMOD_PATH }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 081832ec..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: build_full - -permissions: - contents: write - -on: - push: - tags: - - "*" - -env: - PROJECT: lua-language-server - BIN_DIR: bin - -jobs: - compile: - strategy: - fail-fast: false - matrix: - include: - - { os: ubuntu-22.04, target: linux, platform: linux-x64, container: 'alpine:latest', libc: musl } - - { os: ubuntu-20.04, target: linux, platform: linux-x64, container: 'ubuntu:18.04' } - - { os: ubuntu-20.04, target: linux, platform: linux-arm64, container: 'ubuntu:18.04' } - - { os: macos-11, target: darwin, platform: darwin-x64 } - - { os: macos-11, target: darwin, platform: darwin-arm64 } - - { os: windows-latest, target: windows, platform: win32-ia32 } - - { os: windows-latest, target: windows, platform: win32-x64 } - runs-on: ${{ matrix.os }} - container: - image: ${{ matrix.container }} - steps: - - name: Prepare container - if: ${{ matrix.target == 'linux' && matrix.libc != 'musl' }} - run: | - apt-get update - apt-get install -y software-properties-common - add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-9 and g++-9 - add-apt-repository -y ppa:git-core/ppa # For git>=2.18. - apt-get update - apt-get install -y sudo git gcc-9 g++-9 - - - name: Install aarch64-linux-gnu - if: ${{ matrix.platform == 'linux-arm64' && matrix.libc != 'musl' }} - run: | - apt-get update - apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - - - name: Prepare container env - if: ${{ matrix.target == 'linux' && matrix.libc != 'musl' }} - run: | - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100 - - - name: Prepare container for musl - if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }} - run: | - apk update - apk add git ninja bash build-base nodejs linux-headers - - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Build for others step-1 - if: ${{ matrix.libc != 'musl' }} - uses: actboy168/setup-luamake@master - - - name: Build for others step-2 - if: ${{ matrix.libc != 'musl' }} - run: luamake -platform ${{ matrix.platform }} - - - name: Build for musl - if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }} - run: ./make.sh - - - name: Setting up workflow variables - id: vars - shell: bash - run: | - # Package version - if [[ $GITHUB_REF = refs/tags/* ]]; then - PKG_VERSION=${GITHUB_REF##*/} - else - PKG_VERSION=${GITHUB_SHA:0:7} - fi - - # Package suffix relative to the platform - if [[ "${{ matrix.target }}" = windows ]]; then - PKG_SUFFIX="zip" - else - PKG_SUFFIX="tar.gz" - fi - - # Package name w/ version - PKG_BASENAME="${{ env.PROJECT }}-${PKG_VERSION}-${{ matrix.platform }}" - if [[ "${{ matrix.libc }}" = musl ]]; then - PKG_BASENAME="${PKG_BASENAME}-${{matrix.libc}}" - fi - - # Full name of the tarball asset - PKG_NAME="${PKG_BASENAME}.${PKG_SUFFIX}" - - # Staging area for tarballs - PKG_STAGING="ci_staging/$PKG_BASENAME" - - echo PKG_VERSION=${PKG_VERSION} >> $GITHUB_OUTPUT - echo PKG_BASENAME=${PKG_BASENAME} >> $GITHUB_OUTPUT - echo PKG_NAME=${PKG_NAME} >> $GITHUB_OUTPUT - echo PKG_PATH="${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT - echo PKG_STAGING=${PKG_STAGING} >> $GITHUB_OUTPUT - - - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.vars.outputs.PKG_BASENAME }} - path: | - ${{ env.BIN_DIR }} - main.lua - debugger.lua - LICENSE - changelog.md - locale - doc - meta - script - - - name: Package tarballs - if: startsWith(github.ref, 'refs/tags/') - shell: bash - run: | - STAGING=${{ steps.vars.outputs.PKG_STAGING }} - NAME=${{ steps.vars.outputs.PKG_NAME }} - - # Making the staging area - mkdir -p ${STAGING} - - # Copying binary and runtime files to staging area - cp -r main.lua debugger.lua LICENSE changelog.md locale meta script ${{ env.BIN_DIR }} ${STAGING} - - # Creating release assets - pushd "${STAGING}/" >/dev/null - if [[ "${{ matrix.target }}" = windows ]]; then - 7z -y a ${NAME} * | tail -2 - else - tar czf ${NAME} * - fi - popd >/dev/null - - # Packaging submodules for homebrew distribution - - name: Package submodules - id: submodules - if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.platform == 'darwin-x64' }} - run: | - STAGING=${{ steps.vars.outputs.PKG_STAGING }} - PKG_SUBMOD_NAME="${{ env.PROJECT }}-${{ steps.vars.outputs.PKG_VERSION }}-submodules.zip" - PKG_SUBMOD_PATH="${STAGING}/$PKG_SUBMOD_NAME" - - zip -r $PKG_SUBMOD_PATH ./ -x "*.git*" -x "*.vscode*" -x "build*" -x "${{ env.BIN_DIR }}*" -x "${STAGING}*" -x "3rd/json.lua*" -x "log*" -x "ci_staging*" - - echo PKG_SUBMOD_PATH=${PKG_SUBMOD_PATH} >> $GITHUB_OUTPUT - - - name: Publish release assets - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - generate_release_notes: true - files: | - ${{ steps.vars.outputs.PKG_PATH }} - ${{ steps.submodules.outputs.PKG_SUBMOD_PATH }} diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle -Subproject e260d04c1906904b6b9ae1a87f63b54ca8ba09e +Subproject 416f7ff69140be17c303f9dfd4ceb83be9f366a diff --git a/script/cli/check.lua b/script/cli/check.lua index 4295fa06..146035b6 100644 --- a/script/cli/check.lua +++ b/script/cli/check.lua @@ -11,6 +11,7 @@ local config = require 'config.config' local fs = require 'bee.filesystem' local provider = require 'provider' +require 'plugin' require 'vm' lang(LOCALE) diff --git a/script/plugin.lua b/script/plugin.lua index b297cd9b..b77511ff 100644 --- a/script/plugin.lua +++ b/script/plugin.lua @@ -146,6 +146,7 @@ local function initPlugin(uri) return end local args = config.get(scp.uri, 'Lua.runtime.pluginArgs') + if args == nil then args = {} end if type(pluginConfigPaths) == 'string' then pluginConfigPaths = { pluginConfigPaths } end |