forked from roerohan/react-vnc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(release): setup semantic release, husky, and github actions (roe…
…rohan#7) * feat(release): setup semantic release, husky, and github actions * fix(tests): test script changed back to react-scripts test * fix(actions): name of github action was fixed
- Loading branch information
Showing
11 changed files
with
25,773 additions
and
14,458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
src/noVNC | ||
src/noVNC | ||
build/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Check for lint/build errors | ||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: npm install, lint | ||
run: | | ||
npm install | ||
npm run lint | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: npm install, build | ||
run: | | ||
npm install | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,32 @@ | ||
name: Publish NPM package and Release on GitHub | ||
|
||
name: Release to NPM Registry | ||
on: | ||
push: | ||
branches: [master] | ||
|
||
branches: | ||
- main | ||
jobs: | ||
publish: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
node-version: 15 | ||
registry-url: https://registry.npmjs.org/ | ||
submodules: recursive | ||
|
||
- run: git fetch --all --tags | ||
|
||
- name: Check version change | ||
uses: thebongy/version-check@v1 | ||
id: check | ||
- uses: actions/setup-node@v2 | ||
with: | ||
file: package.json | ||
failBuild: false | ||
tagFormat: v${version} | ||
|
||
- name: Echo variables | ||
run: | | ||
echo "versionChanged- ${{steps.check.outputs.versionChanged}}" | ||
echo "releaseVersion- ${{steps.check.outputs.releaseVersion}}" | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- if: steps.check.outputs.versionChanged == 'true' | ||
run: | | ||
git submodule update --init --recursive | ||
npm install | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- if: steps.check.outputs.versionChanged == 'true' | ||
run: npm run publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}} | ||
- name: Build package | ||
run: npm run build | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
if: steps.check.outputs.versionChanged == 'true' | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.check.outputs.releaseVersion }} | ||
release_name: Release ${{ steps.check.outputs.releaseVersion }} | ||
draft: false | ||
prerelease: false | ||
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint:fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
exec < /dev/tty && npx git-cz --hook || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.github/ | ||
.husky/ | ||
build/ | ||
node_modules/ | ||
src/ | ||
.eslintignore | ||
.gitignore | ||
.gitmodules | ||
.npmignore | ||
.releaserc.json | ||
package-lock.json | ||
prepublish.js | ||
rollup.config.js | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"npmPublish": true, | ||
"tarballDir": "dist" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"package.json", | ||
"package-lock.json", | ||
"CHANGELOG.md" | ||
], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}\n\n\nskip-checks: true" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": "dist/*.tgz" | ||
} | ||
] | ||
], | ||
"repositoryUrl": "https://github.com/roerohan/react-vnc" | ||
} |
Oops, something went wrong.