ci: 2 #28
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: CI | |
on: | |
push: | |
branches: | |
- "ci" | |
tags: | |
- "v*" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
platform: win32 | |
arch: x64 | |
npm_config_arch: x64 | |
rust_target: x86_64-pc-windows-gnu | |
- os: ubuntu-latest | |
platform: linux | |
arch: x64 | |
npm_config_arch: x64 | |
rust_target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
platform: linux | |
arch: arm64 | |
npm_config_arch: arm64 | |
rust_target: aarch64-unknown-linux-gnu | |
- os: macos-latest | |
platform: darwin | |
arch: x64 | |
npm_config_arch: x64 | |
rust_target: x86_64-apple-darwin | |
- os: macos-latest | |
platform: darwin | |
arch: arm64 | |
npm_config_arch: arm64 | |
rust_target: aarch64-apple-darwin | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20.17.0 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- name: Install Cross | |
if: matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest' | |
run: cargo install cross | |
- name: Build with Cargo or Cross | |
run: node ./github/scripts/build.js | |
env: | |
MATRIX_ARCH: ${{ matrix.arch }} | |
MATRIX_OS: ${{ matrix.os }} | |
MATRIX_RUST_TARGET: ${{ matrix.rust_target }} | |
- run: npm install | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
npm_config_arch: ${{ matrix.npm_config_arch }} | |
- name: build client and move execute file | |
run: | | |
npx webpack --mode production --config webpack.config.js | |
node .github/scripts/moveRelease.js | |
env: | |
TARGET: ${{ matrix.rust_target }} | |
- shell: pwsh | |
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV | |
- run: node .github/scripts/package.js | |
env: | |
GITHUB_EVENT_HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
TARGET: ${{ env.target }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.target }} | |
path: "*.vsix" | |
publish: | |
runs-on: ubuntu-latest | |
needs: build | |
if: success() && startsWith( github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v4 | |
- run: | | |
# if [[ "${{ github.event.head_commit.message }}" == *"-pre"* ]]; then | |
# npx vsce publish --pre-release --packagePath $(find . -iname *.vsix) | |
# else | |
# npx vsce publish --packagePath $(find . -iname *.vsix) | |
# fi | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} |