Skip to content

Commit 7f7ef08

Browse files
committed
ops: Merge Publish workflows
1 parent 808d494 commit 7f7ef08

2 files changed

Lines changed: 22 additions & 46 deletions

File tree

.github/workflows/Publish Pre-release.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/Publish.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ on:
1111
- patch
1212
- minor
1313
- major
14+
- keep
15+
push:
16+
branches:
17+
- main
18+
paths:
19+
- '**.json'
1420

1521
jobs:
1622
release:
@@ -22,24 +28,31 @@ jobs:
2228
run: | # shell
2329
npm i
2430
25-
- name: Setup Github Actions # allow use of `git push`
26-
run: | # shell
27-
git config --global user.name "RedCMD"
28-
git config --global user.email "theredcmd@gmail.com"
29-
git add .
30-
git diff-index --quiet HEAD || git commit -m "Sync Github Actions"
31-
3231
- name: Run Tests # check grammars are working
3332
run: | # shell
3433
npm run test
3534
35+
- name: Setup Github Actions # allow use of `git push`
36+
run: | # shell
37+
git config user.name "github-actions[bot]"
38+
git config user.email "github-actions[bot]@users.noreply.github.com"
39+
git add .
40+
git diff-index --quiet HEAD || git commit -m "Sync Github Actions" || exit 0
41+
3642
- name: Package Extension # `.vsix` file
3743
run: | # shell
38-
npm run package --- ${{ github.event.inputs.version }}
44+
if [ "${{ github.event.inputs.version }}" = "keep" ]; then
45+
npm run package
46+
elif [ "${{ github.event.inputs.version }}" = "" ]; then
47+
npm run package --- patch --pre-release
48+
else
49+
npm run package --- ${{ github.event.inputs.version }}
50+
fi
3951
git push --follow-tags
40-
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
52+
echo VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
4153
4254
- name: Generate Release # create release page on github with `.vsix` file
55+
if: github.event.inputs.version
4356
run: | # shell
4457
gh release create v$VERSION --generate-notes json-embedded-languages-$VERSION.vsix
4558
env:

0 commit comments

Comments
 (0)