Skip to content

Commit

Permalink
ci: automated release [skip release] (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
harrydowning authored Jun 29, 2024
1 parent 935e4c9 commit ed32c8e
Show file tree
Hide file tree
Showing 6 changed files with 2,061 additions and 8 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: pipeline

on: [push]

jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip release]')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
- run: npm i
- run: npx vsce package
- run: echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
- run: gh release create v$VERSION --generate-notes yaml-embedded-languages-$VERSION.vsix
env:
GH_TOKEN: ${{ github.token }}
- run: npx vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
*.vsix
12 changes: 4 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thank you for taking an interest in contributing to this project. All contributions are welcome. Please find below the suggested contribution and development workflows.
Thank you for taking an interest in contributing to this project. All contributions are welcome. Please find below the suggested contribution, development, and release workflows.

## Contribution Workflow [#](#contribution-workflow- "Contribution Workflow")

Expand All @@ -17,10 +17,6 @@ Thank you for taking an interest in contributing to this project. All contributi

## Release Workflow [#](#release-workflow- "Release Workflow")

- Ensure changes, updated `VERSION` in `extension.js`, and updated `CHANGELOG.md` are committed
- Run `vsce package` to build the extension
- Create a new GitHub release
- Use `VERSION` for the tag and title
- Use latest in `CHANGELOG.md` for the body
- Attach `*.vsix` build of the new release
- Run `vsce publish` to publish extension to the marketplace
- Update `VERSION` in `extension.js` and run `node extension.js -dev`
- Update `CHANGELOG.md`
- Merge to master without `[skip release]` in the commit
3 changes: 3 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ const getPackageJson = (languages) => ({
},
},
},
devDependencies: {
"@vscode/vsce": "^2.29.0",
},
});

const getPatterns = (languages) => {
Expand Down
Loading

0 comments on commit ed32c8e

Please sign in to comment.