upload artifacts #8
Workflow file for this run
This file contains hidden or 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 LSP | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| name: Build for ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| artifact_name: htmlsnob_lsp-linux | |
| asset_name: htmlsnob_lsp-linux-x86_64 | |
| - os: windows-latest | |
| artifact_name: htmlsnob_lsp.exe | |
| asset_name: htmlsnob_lsp-windows-x86_64.exe | |
| - os: macos-latest | |
| artifact_name: htmlsnob_lsp | |
| asset_name: htmlsnob_lsp-macos-x86_64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build Release | |
| run: cargo build -p htmlsnob_lsp --release | |
| - name: Rename binary (for identification) | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.os }}" = "windows-latest" ]; then | |
| mv target/release/htmlsnob_lsp.exe ${{ matrix.asset_name }} | |
| else | |
| mv target/release/htmlsnob_lsp ${{ matrix.asset_name }} | |
| fi | |
| - name: Upload Artifact to use in subsequent jobs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: ${{ matrix.asset_name }} | |
| - name: Upload to Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ matrix.asset_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-extension: | |
| name: Publish VS Code Extension | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Download all LSP binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: htmlsnob_vscode_extension/bin/ | |
| merge-multiple: true | |
| - name: Set Extension Version | |
| working-directory: htmlsnob_vscode_extension | |
| run: | | |
| CLEAN_VERSION=${GITHUB_REF_NAME#v} # Remove the 'v' prefix if it exists | |
| npm version $CLEAN_VERSION --no-git-tag-version | |
| - name: Install vsce and Publish | |
| working-directory: htmlsnob_vscode_extension | |
| run: | | |
| npm install | |
| npx @vscode/vsce publish | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} |