Skip to content

Commit 211f621

Browse files
authored
Update publish workflow, version and preview flag (#135)
1 parent 178a652 commit 211f621

File tree

2 files changed

+25
-37
lines changed

2 files changed

+25
-37
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,26 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: Install Node.js
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: 18.x
20-
21-
- name: Install Dependencies
22-
run: npm ci
23-
24-
- name: Install VSCE
25-
run: npm install -g vsce
26-
27-
- name: Update version and default in package.json
28-
run: |
29-
TAG_NAME=${{ github.ref_name }}
30-
VERSION=${TAG_NAME#v}
31-
VERSION=${VERSION%-beta}
32-
if [[ "$TAG_NAME" == *"-beta"* ]]; then
33-
jq --arg version "$VERSION" --arg default "beta" '.version = $version | .contributes.configuration.properties["dev-proxy-toolkit.version"].default = $default' package.json > package.tmp.json
34-
else
35-
jq --arg version "$VERSION" --arg default "stable" '.version = $version | .contributes.configuration.properties["dev-proxy-toolkit.version"].default = $default' package.json > package.tmp.json
36-
fi
37-
mv package.tmp.json package.json
38-
39-
- name: Publish
40-
env:
41-
VSCE_PAT: ${{ secrets.VSCE_PAT }}
42-
run: |
43-
if [[ "$TAG_NAME" == *"-beta"* ]]; then
44-
vsce publish --pre-release
45-
else
46-
vsce publish
47-
fi
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18.x
20+
21+
- name: Install Dependencies
22+
run: npm ci
23+
24+
- name: Install VSCE
25+
run: npm install -g vsce
26+
27+
- name: Publish
28+
env:
29+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
30+
run: |
31+
if [[ "${GITHUB_REF}" == *"-beta" ]]; then
32+
vsce publish --pre-release
33+
else
34+
vsce publish
35+
fi

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "dev-proxy-toolkit",
33
"displayName": "Dev Proxy Toolkit",
44
"description": "Makes it easy to create and update Dev Proxy configuration files.",
5-
"version": "0.8.0",
5+
"version": "0.9.0",
66
"publisher": "garrytrinder",
77
"engines": {
88
"vscode": "^1.85.0"
@@ -130,7 +130,7 @@
130130
}
131131
}
132132
},
133-
"preview": true,
133+
"preview": false,
134134
"pricing": "Free",
135135
"icon": "dist/icon.png",
136136
"homepage": "https://github.com/garrytrinder/dev-proxy-toolkit/blob/main/README.md",

0 commit comments

Comments
 (0)