Skip to content

Commit

Permalink
Merge pull request #8 from tat3/add-deploy-action
Browse files Browse the repository at this point in the history
Add release action
  • Loading branch information
tat3 authored Sep 4, 2022
2 parents a4e21ef + ec00a21 commit f531acd
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
on:
push:
branches:
- '*'
pull_request:

jobs:
build:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on: push

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: yarn install
- run: yarn global add vsce

- name: Parse tag and save it in env if tag event
if: startsWith(github.ref, 'refs/tags/')
run: echo "EXTENSION_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Set version to package.json
if: startsWith(github.ref, 'refs/tags/')
run: sed -i -e "s/0.0.0-EXTENSIONVERSION/$EXTENSION_VERSION/g" package.json

- name: Build extension
run: vsce package

- name: Release to github release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: '*.vsix'
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
push:
branches:
- '*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: yarn install
- run: xvfb-run -a yarn test
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "markdown-pdf-2",
"displayName": "Markdown PDF 2",
"description": "Convert Markdown to PDF. Forked from yzane/vscode-markdown-pdf.",
"version": "0.1.0",
"version": "0.0.0-EXTENSIONVERSION",
"publisher": "tat3",
"icon": "images/icon.png",
"engines": {
Expand Down Expand Up @@ -481,13 +481,14 @@
},
"scripts": {
"vscode:prepublish": "node ./src/compile",
"test": "node ./test/runTest.js"
"test": "node ./test/runTest.js",
"build": "vsce package"
},
"devDependencies": {
"@vscode/test-electron": "^2.1.5",
"glob": "^7.1.6",
"mocha": "^7.1.1",
"removeNPMAbsolutePaths": "^2.0.0",
"vscode-test": "^1.3.0"
"removeNPMAbsolutePaths": "^2.0.0"
},
"dependencies": {
"cheerio": "^0.20.0",
Expand Down
2 changes: 1 addition & 1 deletion test/runTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const path = require('path');
const runTests = require('vscode-test').runTests;
const runTests = require('@vscode/test-electron').runTests;

async function main() {
try {
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.1.tgz#d9ba43490fa3a3df958759adf69396c3532cf2c1"
integrity sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw==

"@vscode/test-electron@^2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@vscode/test-electron/-/test-electron-2.1.5.tgz#ac98f8f445ea4590753f5fa0c7f6e4298f08c3b7"
integrity sha512-O/ioqFpV+RvKbRykX2ItYPnbcZ4Hk5V0rY4uhQjQTLhGL9WZUvS7exzuYQCCI+ilSqJpctvxq2llTfGXf9UnnA==
dependencies:
http-proxy-agent "^4.0.1"
https-proxy-agent "^5.0.0"
rimraf "^3.0.2"
unzipper "^0.10.11"

abab@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"
Expand Down Expand Up @@ -2238,16 +2248,6 @@ [email protected]:
core-util-is "1.0.2"
extsprintf "^1.2.0"

vscode-test@^1.3.0:
version "1.6.1"
resolved "https://registry.yarnpkg.com/vscode-test/-/vscode-test-1.6.1.tgz#44254c67036de92b00fdd72f6ace5f1854e1a563"
integrity sha512-086q88T2ca1k95mUzffvbzb7esqQNvJgiwY4h29ukPhFo8u+vXOOmelUoU5EQUHs3Of8+JuQ3oGdbVCqaxuTXA==
dependencies:
http-proxy-agent "^4.0.1"
https-proxy-agent "^5.0.0"
rimraf "^3.0.2"
unzipper "^0.10.11"

webidl-conversions@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-2.0.1.tgz#3bf8258f7d318c7443c36f2e169402a1a6703506"
Expand Down

0 comments on commit f531acd

Please sign in to comment.