Skip to content

Commit aabe6b4

Browse files
authored
Merge pull request #4 from Automattic/add/publish
ci: Add publish workflow
2 parents 33906e3 + 15bd7d4 commit aabe6b4

File tree

4 files changed

+101
-4
lines changed

4 files changed

+101
-4
lines changed

.github/workflows/push-tag.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: Pre-release checks
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Check out the source code
20+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
21+
22+
- name: Set up Node.js environment
23+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
24+
with:
25+
node-version: 16.x
26+
cache: npm
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run tests
32+
run: xvfb-run -a npm test
33+
34+
create-release:
35+
name: Create a release
36+
runs-on: ubuntu-latest
37+
needs: test
38+
permissions:
39+
contents: write
40+
steps:
41+
- name: Check out the source code
42+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
43+
44+
- name: Set up Node.js environment
45+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
46+
with:
47+
node-version: 16.x
48+
cache: npm
49+
50+
- name: Install dependencies
51+
run: npm ci
52+
53+
- name: Package extension
54+
run: npm run package
55+
56+
- name: Create a release
57+
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
58+
with:
59+
generate_release_notes: true
60+
files: |
61+
logwatcher-*.vsix
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.REPOSITORY_ACCESS_TOKEN }}

.github/workflows/vsce-publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
publish:
13+
name: Publish to VSCode Marketplace
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
steps:
18+
- name: Check out the source code
19+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
20+
21+
- name: Set up Node.js environment
22+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
23+
with:
24+
node-version: 16.x
25+
cache: npm
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Publish
31+
run: npm run deploy
32+
env:
33+
VSCE_PAT: ${{ secrets.VSCE_PAT }}

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "logwatcher",
3-
"publisher": "wwa83",
3+
"publisher": "automattic",
44
"displayName": "Log Watcher",
55
"description": "Log Watcher is an extension for VSCode to watch logs and display them in the \"Output\" tab, much like what \"tail -F\" does.",
66
"version": "0.0.1",
@@ -61,6 +61,7 @@
6161
"pretest": "npm run compile && npm run lint",
6262
"lint": "eslint src --ext ts",
6363
"test": "node ./out/test/runTest.js",
64+
"package": "vsce package",
6465
"deploy": "vsce publish"
6566
},
6667
"devDependencies": {

0 commit comments

Comments
 (0)