cargo update #18
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: build in muti platform | |
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
build: | |
if: startsWith( github.ref, 'refs/tags/') | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
platform: win32 | |
arch: x64 | |
npm_config_arch: x64 | |
- os: windows-latest | |
platform: win32 | |
arch: ia32 | |
npm_config_arch: ia32 | |
- os: windows-latest | |
platform: win32 | |
arch: arm64 | |
npm_config_arch: arm | |
- os: ubuntu-latest | |
platform: linux | |
arch: x64 | |
npm_config_arch: x64 | |
- os: ubuntu-latest | |
platform: linux | |
arch: arm64 | |
npm_config_arch: arm64 | |
- os: ubuntu-latest | |
platform: linux | |
arch: armhf | |
npm_config_arch: arm | |
- os: ubuntu-latest | |
platform: alpine | |
arch: x64 | |
npm_config_arch: x64 | |
- os: macos-latest | |
platform: darwin | |
arch: x64 | |
npm_config_arch: x64 | |
- os: macos-latest | |
platform: darwin | |
arch: arm64 | |
npm_config_arch: arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- run: cargo build --release | |
# - run: cargo test --release | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: npm install | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
npm_config_arch: ${{ matrix.npm_config_arch }} | |
- shell: pwsh | |
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV | |
- run: npx vsce ls | |
- run: npx vsce package --target ${{ env.target }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.target }} | |
path: "*.vsix" | |
publish: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
needs: build | |
if: success() && startsWith( github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v3 | |
- run: npx vsce publish --packagePath $(find . -iname *.vsix) | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
- name: GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: $(find . -iname *.vsix) |