Skip to content

refactor: post pull all (#282) #112

refactor: post pull all (#282)

refactor: post pull all (#282) #112

# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Publish extension to vscode extension marketplace
on:
push:
tags:
- v*.*.*
env:
GITLAB_NPM_TOKEN: ${{secrets.GITLAB_NPM_TOKEN}}
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
npm_config_arch: x64
- 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:
- name: Check out
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Step rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: nightly-2023-06-09
- name: Setup wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Setup rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "rs"
- name: NPM install
run: npm ci
- name: Build wasm
run: wasm-pack build rs --target=nodejs --out-dir ../src/wasm
- name: Build node
env:
CLIENTID: ${{ secrets.OAUTHCLIENTID }}
CLIENTSECRET: ${{ secrets.OAUTHCLIENTSECRET }}
run: |
npm run package
- name: Version
id: version
shell: bash
run: echo "VERSION=${{ github.ref_name }}" | sed 's/v//' >> $GITHUB_OUTPUT
- name: Target
id: target
shell: bash
run: echo "TARGET=${{ matrix.platform }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
- name: Package
run: |
npx @vscode/vsce package --target ${{ steps.target.outputs.TARGET }} --no-git-tag-version --no-update-package-json ${{ steps.version.outputs.VERSION }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.target.outputs.TARGET }}
path: '*.vsix'
publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
- run: |
npx @vscode/vsce publish --packagePath $(find . -iname *.vsix) -p ${{ secrets.VSCETOKEN }}