mirror of
https://github.com/Silverquark/dance.git
synced 2024-08-17 06:41:19 +03:00
- separate publishing to a separate job - remove redundant calls to `success()` - only publish if `github.event_name` is "push"
63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
run: yarn
|
|
|
|
- name: Check formatting and lints
|
|
run: yarn run check
|
|
|
|
- name: Ensure auto-generated files are up-to-date
|
|
run: yarn run ts-node ./meta.ts --ensure-up-to-date --check
|
|
|
|
- name: Check tests
|
|
run: xvfb-run -a yarn run test
|
|
env:
|
|
MOCHA_REPORTER: dot
|
|
|
|
publish:
|
|
needs: check
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Create tag based on package.json
|
|
uses: butlerlogic/action-autotag@ade8d2e19bfcd1e6a91272e2849b4bf4c37a67f1
|
|
id: autotag
|
|
with:
|
|
tag_prefix: v
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Publish to Open VSX Registry
|
|
uses: HaaLeo/publish-vscode-extension@8dd35ed51f326dfb0a3e9cfc6baeca81781229fc
|
|
if: ${{ steps.autotag.outputs.tagcreated == 'yes' }}
|
|
id: publishToOpenVSX
|
|
with:
|
|
pat: ${{ secrets.OPEN_VSX_TOKEN }}
|
|
yarn: true
|
|
|
|
- name: Publish to Visual Studio Marketplace
|
|
uses: HaaLeo/publish-vscode-extension@8dd35ed51f326dfb0a3e9cfc6baeca81781229fc
|
|
if: ${{ steps.autotag.outputs.tagcreated == 'yes' }}
|
|
with:
|
|
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
|
|
registryUrl: https://marketplace.visualstudio.com
|
|
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
|
|
packagePath: ''
|
|
yarn: true
|