diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f8adb7..a15ea1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,28 +32,36 @@ jobs: strategy: matrix: platforms: - - os: ubuntu-20.04 + - os: ubuntu-18.04 target: x86_64-unknown-linux-gnu + dir: server/mcshader-lsp - os: windows-latest - target: x86_64-windows-msvc + target: x86_64-windows-msvc.exe + dir: server/mcshader-lsp.exe - os: macos-10.15 target: x86_64-apple-darwin + dir: server/mcshader-lsp steps: - uses: actions/checkout@v2 + - name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + default: true - name: Build server - run: cargo build --release + run: cargo build --release --out-dir . -Z unstable-options - name: Upload release file uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.empty-release.outputs.upload_url }} - asset_path: target/release/mcshader-lsp + asset_path: ${{ matrix.platforms.dir }} asset_name: mcshader-lsp-${{ matrix.platforms.target }} asset_content_type: application/octet-stream release-vscode-extension: runs-on: ubuntu-20.04 - needs: empty-release + needs: [release-server, empty-release] steps: - uses: actions/checkout@v2 - run: npm i diff --git a/.vscodeignore b/.vscodeignore index 49b3aec..8dfd9c6 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -7,5 +7,4 @@ server/ *.py .gitignore **/*.yml -**/*.md **/*.txt \ No newline at end of file diff --git a/client/src/extension.ts b/client/src/extension.ts index 1028484..9ba64ee 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -82,8 +82,6 @@ export class Extension { const exists = await fs.stat(dest).then(() => true, () => false) if (!exists) await this.state.updateServerVersion(undefined) - this.state.updateServerVersion('borger') - const release = await getReleaseInfo(this.package.version) const platform = platforms[`${process.arch} ${process.platform}`] @@ -94,7 +92,7 @@ export class Extension { if (release.tag_name === this.state.serverVersion) return - const artifact = release.assets.find(artifact => artifact.name === `mcshader-lsp-${platform}`) + const artifact = release.assets.find(artifact => artifact.name === `mcshader-lsp-${platform}${(process.platform === 'win32' ? '.exe' : '')}`) const userResponse = await vscode.window.showInformationMessage( this.state.serverVersion == undefined ? diff --git a/client/src/lspClient.ts b/client/src/lspClient.ts index 456b322..8f20423 100644 --- a/client/src/lspClient.ts +++ b/client/src/lspClient.ts @@ -11,8 +11,9 @@ export class LanguageClient extends lsp.LanguageClient { constructor(ext: Extension) { super('vscode-mc-shader', 'VSCode MC Shader', { command: process.env['MCSHADER_DEBUG'] ? - ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'mcshader-lsp')) : - path.join(ext.context.globalStoragePath, 'mcshader-lsp') + ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'mcshader-lsp')) + + (process.platform === 'win32' ? '.exe' : '') : + path.join(ext.context.globalStoragePath, 'mcshader-lsp') }, { documentSelector: [{scheme: 'file', language: 'glsl'}], outputChannel: lspOutputChannel, diff --git a/client/src/persistent_state.ts b/client/src/persistent_state.ts index 271d120..c54354b 100644 --- a/client/src/persistent_state.ts +++ b/client/src/persistent_state.ts @@ -7,9 +7,10 @@ export class PersistentState { log.info('working with state', { serverVersion }) } - get serverVersion(): string | undefined { + public get serverVersion(): string | undefined { return this.state.get('serverVersion') } + async updateServerVersion(value: string | undefined) { await this.state.update('serverVersion', value) } diff --git a/package.json b/package.json index d460709..5ebe949 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-mc-shader", "displayName": "Minecraft GLSL Shaders", "description": "A Visual Studio Code extension for linting/etc Minecraft GLSL Shaders", - "version": "0.9.0", + "version": "0.9.1", "publisher": "Strum355", "author": "Noah Santschi-Cooney (Strum355)", "license": "MIT",