Fix issues #247 & #249 #608
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the main branch | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
# We will use windows since there are some limitation for Ubuntu to run our test | |
# runs-on: ubuntu-latest | |
runs-on: windows-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
- name: get version | |
id: update_version | |
# See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions | |
run: | | |
$version=node -p "require('./package.json').version" | |
$version=$version+"-${{github.sha}}" | |
echo "::set-output name=VERSION::$version" | |
shell: pwsh | |
- name: Build | |
run: | | |
python pack.py | |
- name: Upload package-lock.json | |
uses: actions/upload-artifact@v2 | |
with: | |
name: localFile | |
path: package-lock.json | |
# Keep this in case we switch to Linux OS someday | |
# - name: Run tests on Linux OS | |
# run: xvfb-run -a npm test | |
# if: runner.os == 'Linux' | |
- name: Run tests on Windows OS | |
run: npm test | |
if: runner.os != 'Linux' | |
- name: Run e2e tests | |
run: npm run e2etest | |
if: runner.os != 'Linux' | |
#- name: Initialize CodeQL | |
# uses: github/codeql-action/init@v1 | |
# with: | |
# languages: javascript | |
# config-file: ./.github/codeql/codeql-config.yml | |
#- name: Perform CodeQL Analysis | |
# uses: github/codeql-action/analyze@v1 | |
- name: Create release | |
id: create_release | |
if: ${{ github.event_name =='push' && github.ref == 'refs/heads/main'}} | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.update_version.outputs.VERSION }} | |
release_name: Release v${{ steps.update_version.outputs.VERSION }} | |
body: | | |
Autogenerated by CI. | |
draft: false | |
prerelease: true | |
- name: Upload vsix as release asset | |
if: ${{ github.event_name =='push' && github.ref == 'refs/heads/main'}} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./autolispext.vsix | |
asset_name: autolispext.vsix | |
asset_content_type: application/zip |