Release VS Code Plugin #4
Workflow file for this run
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
name: Release VS Code Plugin | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
package: | |
name: Package - ${{ matrix.platform.code_target }} | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
platform: | |
- os: windows-latest | |
rust_target: x86_64-pc-windows-msvc | |
code_target: win32-x64 | |
- os: macOS-latest | |
rust_target: x86_64-apple-darwin | |
code_target: darwin-x64 | |
- os: macOS-latest | |
rust_target: aarch64-apple-darwin | |
code_target: darwin-arm64 | |
- os: ubuntu-20.04 | |
rust_target: x86_64-unknown-linux-gnu | |
code_target: linux-x64 | |
- os: ubuntu-20.04 | |
rust_target: aarch64-unknown-linux-gnu | |
code_target: linux-arm64 | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Build harper-ls | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
target: ${{ matrix.platform.rust_target }} | |
args: "--locked --release --bin harper-ls" | |
strip: true | |
- name: Package extension | |
id: package_extension | |
shell: bash | |
run: | | |
bin_dir="packages/vscode-plugin/bin" | |
release_dir="target/${{ matrix.platform.rust_target }}/release" | |
mkdir "$bin_dir" | |
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then | |
cp "${release_dir}/harper-ls.exe" "$bin_dir" | |
else | |
cp "${release_dir}/harper-ls" "$bin_dir" | |
fi | |
just package-vscode ${{ matrix.platform.code_target }} | |
echo artifact=$(echo packages/vscode-plugin/*.vsix) >> $GITHUB_OUTPUT | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "./packages/vscode-plugin/*.vsix" | |
allowUpdates: true | |
draft: true | |
- name: Publish to OpenVSX | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
packagePath: "./packages/vscode-plugin/" | |
extensionFile: ${{ steps.package_extension.outputs.artifact }} | |
skipDuplicate: true | |
- name: Publish to the Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
packagePath: "./packages/vscode-plugin/" | |
extensionFile: ${{ steps.package_extension.outputs.artifact }} | |
registryUrl: https://marketplace.visualstudio.com |