This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: remove husky, add semantic-pull-request (#29)
- Split runs for PR vs main. - Minor task touchups - Get rid of Husky and commitlint. - Enable `semantic-pull-requests` GH application for linting of PR title / squash and merge workflow. We no longer need commitlint. Closes #24 - Document best practices for PR and actual release. Closes #21
- Loading branch information
1 parent
df173f3
commit d564349
Showing
4 changed files
with
88 additions
and
377 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,35 +1,54 @@ | ||
name: Publish | ||
on: [ push ] | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
publish: | ||
name: Publish | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [14.x] | ||
|
||
steps: | ||
- | ||
name: Checkout code | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- | ||
name: Use Node.js 14 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
- | ||
run: npm install -g yarn | ||
- | ||
run: yarn install --frozen-lockfile | ||
- | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install | ||
run: yarn install --frozen-lockfile --non-interactive | ||
|
||
- name: Build | ||
run: yarn run build | ||
- | ||
|
||
- name: Add npm token | ||
run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc | ||
- | ||
|
||
# Only do a dry-run in Pull Request | ||
- name: Publish (dry-run) | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
run: yarn run semantic-release --dry-run | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- | ||
run: yarn run semantic-release | ||
|
||
# Release release in merge to default branch | ||
- name: Publish | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: yarn run semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
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
Oops, something went wrong.