Skip to content

Commit

Permalink
chore: added github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronF86 committed Nov 10, 2024
1 parent 8264a81 commit a6ab15f
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run compile
- run: xvfb-run -a npm test
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish
on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: npm ci
- run: npm run package
- name: Publish to VS Code Marketplace
run: npx vsce publish -p ${{ secrets.VSCE_PAT }}
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: npm ci
- run: npm run package
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributing Guide

## Development Setup
1. Fork and clone the repo
2. `npm install` to install dependencies
3. `npm run watch` to start development
4. Make changes to the code
5. `npm test` to run tests
6. Create PR following conventional commits

## Commit Convention
- feat: New feature
- fix: Bug fix
- docs: Documentation
- style: Formatting
- refactor: Code restructure
- test: Tests
- chore: Maintenance

## Release Process
1. Update version in package.json
2. Create changelog entry
3. Commit with "chore: release vX.X.X"
4. Tag with "vX.X.X"
5. Push commits and tags

## Versioning
This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
}
},
"scripts": {
"vscode:prepublish": "npm run package",
"vscode:prepublish": "npm run lint && npm run test && npm run package",
"compile": "webpack",
"watch": "webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "npm run compile-tests && npm run compile && npm run lint",
"lint": "eslint src",
"test": "vscode-test"
"lint": "eslint src --ext ts",
"test": "vscode-test",
"preversion": "npm run test",
"version": "npm run package && git add -A",
"postversion": "git push && git push --tags"
},
"devDependencies": {
"@types/mocha": "^10.0.9",
Expand All @@ -81,5 +81,14 @@
"typescript": "^4.5.5",
"webpack": "^5.69.0",
"webpack-cli": "^4.10.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.ts": ["eslint --fix", "prettier --write"]
}
}

0 comments on commit a6ab15f

Please sign in to comment.