From ff04a1c388930a81b6c2d436db880560ec52e951 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 14 Sep 2024 18:03:26 +0200 Subject: [PATCH] ci: add test and publish workflows --- .github/workflows/publish.yml | 51 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 19 +++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6085ff6 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,51 @@ +name: publish + +on: + push: + branches: + - dev + - stable + +jobs: + build: + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux + arch: x64 + npm_config_arch: x64 + - os: windows-latest + platform: win32 + 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@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - 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 package --target ${{ env.target }} + - uses: actions/upload-artifact@v2 + with: + name: ${{ env.target }} + path: "*.vsix" + + publish: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/download-artifact@v2 + - run: npx vsce publish --packagePath $(find . -iname *.vsix) + env: + VSCE_PAT: ${{ secrets.AZURE_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2c24cd2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +name: test + +on: + push: + branches: + - dev + +jobs: + build+test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14.x + - run: npm install + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: npx vsce package # TODO run tests? does this even validate?