Skip to content

Commit 51e6021

Browse files
committed
Update GitHub workflows
1 parent 8ab4e36 commit 51e6021

File tree

2 files changed

+29
-39
lines changed

2 files changed

+29
-39
lines changed

.github/workflows/Publish Pre-release.yml

+10-20
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- 'main'
7+
- main
88
paths:
99
- '**.json'
1010

@@ -14,30 +14,20 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@master
1616

17-
- name: Install Dependencies
18-
run: | # vsce etc
17+
- name: Install Dependencies # vsce etc
18+
run: | # shell
1919
npm i
2020
21-
- name: Setup Github Actions
22-
run: | # allow use of `git push`
21+
- name: Setup Github Actions # allow use of `git push`
22+
run: | # shell
2323
git config --global user.name "RedCMD"
2424
git config --global user.email "[email protected]"
2525
git add .
2626
git diff-index --quiet HEAD || git commit -m "Sync Github Actions"
2727
28-
- name: Package Extension
29-
run: | # `.vsix` file
30-
npx vsce package patch --pre-release
31-
git push
32-
git push --tags
33-
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
34-
35-
- name: Generate Release
36-
run: | # create release page on github with `.vsix` file
37-
gh release create v$VERSION --generate-notes --prerelease json-embedded-languages-$VERSION.vsix
28+
- name: Publish Pre-release # upload to Extension Marketplace
29+
run: | # shell
30+
npx vsce publish patch --pre-release
31+
git push --follow-tags
3832
env:
39-
GH_TOKEN: ${{ github.token }}
40-
41-
- name: Publish Pre-release
42-
run: | # upload to Extension Marketplace
43-
npx vsce publish --pre-release -p ${{ secrets.VSCE_PAT }} --packagePath json-embedded-languages-$VERSION.vsix
33+
VSCE_PAT: ${{ secrets.VSCE_PAT }}

.github/workflows/Publish.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version'
8-
required: true
9-
default: 'minor'
7+
description: Version
8+
default: minor
109
type: choice
1110
options:
12-
- patch
13-
- minor
14-
- major
11+
- patch
12+
- minor
13+
- major
1514

1615
jobs:
1716
release:
1817
runs-on: ubuntu-latest
1918
steps:
2019
- uses: actions/checkout@master
2120

22-
- name: Install Dependencies
23-
run: | # vsce etc
21+
- name: Install Dependencies # vsce etc
22+
run: | # shell
2423
npm i
2524
26-
- name: Setup Github Actions
27-
run: | # allow use of `git push`
25+
- name: Setup Github Actions # allow use of `git push`
26+
run: | # shell
2827
git config --global user.name "RedCMD"
2928
git config --global user.email "[email protected]"
3029
git add .
3130
git diff-index --quiet HEAD || git commit -m "Sync Github Actions"
3231
33-
- name: Package Extension
34-
run: | # `.vsix` file
32+
- name: Package Extension # `.vsix` file
33+
run: | # shell
3534
npx vsce package ${{ github.event.inputs.version }}
36-
git push
37-
git push --tags
35+
git push --follow-tags
3836
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
3937
40-
- name: Generate Release
41-
run: | # create release page on github with `.vsix` file
38+
- name: Generate Release # create release page on github with `.vsix` file
39+
run: | # shell
4240
gh release create v$VERSION --generate-notes json-embedded-languages-$VERSION.vsix
4341
env:
4442
GH_TOKEN: ${{ github.token }}
4543

46-
- name: Publish Release
47-
run: | # upload to Extension Marketplace
48-
npx vsce publish -p ${{ secrets.VSCE_PAT }} --packagePath json-embedded-languages-$VERSION.vsix
44+
- name: Publish Release # upload to Extension Marketplace
45+
run: | # shell
46+
npx vsce publish --packagePath json-embedded-languages-$VERSION.vsix
47+
env:
48+
VSCE_PAT: ${{ secrets.VSCE_PAT }}

0 commit comments

Comments
 (0)