Skip to content

Commit

Permalink
Add GitHub releases to publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Nov 27, 2024
1 parent 1213a22 commit c0e96af
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/publish pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Install Dependencies
run: |
- name: Install Dependencies # vsce etc
run: | # shell
npm i
npm i @vscode/vsce -g
- name: Build Extension
run: npm run build
- name: Build Extension # build `extension.js` and `*.wasm` files
run: | # shell
npm run build
- name: Setup Github Actions
run: |
- name: Setup Github Actions # allow use of `git push`
run: | # shell
git config --global user.name "RedCMD"
git config --global user.email "[email protected]"
git add .
git diff-index --quiet HEAD || git commit -m "Sync Github Actions"
- name: Publish Pre-release
run: |
vsce publish patch --pre-release -p ${{ secrets.VSCE_PAT }}
git push
- name: Publish Pre-release # upload to Extension Marketplace
run: | # shell
npx vsce publish patch --pre-release -p ${{ secrets.VSCE_PAT }}
git push --follow-tags
41 changes: 26 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,46 @@ on:
inputs:
version:
description: 'Version'
default: 'minor x.1.0'
default: 'minor'
type: choice
options:
- patch x.x.1
- minor x.1.0
- major 1.0.0
- patch
- minor
- major

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Install Dependencies
run: |
- name: Install Dependencies # vsce etc
run: | # shell
npm i
npm i @vscode/vsce -g
- name: Build Extension
run: npm run build
- name: Build Extension # build `extension.js` and `*.wasm` files
run: | # shell
npm run build
- name: Setup Github Actions
run: |
- name: Setup Github Actions # allow use of `git push`
run: | # shell
git config --global user.name "RedCMD"
git config --global user.email "[email protected]"
git add .
git diff-index --quiet HEAD || git commit -m "Sync Github Actions"
- name: Publish Release
run: |
vsce publish ${{ github.event.inputs.version }} -p ${{ secrets.VSCE_PAT }}
git push
- name: Package Extension # `.vsix` file
run: | # shell
npx vsce package ${{ github.event.inputs.version }}
git push --follow-tags
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
- name: Generate Release # create release page on github with `.vsix` file
run: | # shell
gh release create v$VERSION --generate-notes tmlanguage-syntax-highlighter-$VERSION.vsix
env:
GH_TOKEN: ${{ github.token }}

- name: Publish Release # upload to Extension Marketplace
run: | # shell
npx vsce publish -p ${{ secrets.VSCE_PAT }} --packagePath tmlanguage-syntax-highlighter-$VERSION.vsix
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"browser": "./out/web/extension.js",
"scripts": {
"build": "npm run compile && npm run compile-web && npm run generate-wasm",
"version": "git rm -f --ignore-unmatch *.vsix && vsce package && git add -f --ignore-errors *.vsix",
"package": "vsce package",
"watch": "tsc -watch -p ./",
"watch-web": "webpack --watch",
Expand Down

1 comment on commit c0e96af

@RedCMD
Copy link
Owner Author

@RedCMD RedCMD commented on c0e96af Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove .vsix file from files
#13

Please sign in to comment.