Merge pull request #50 from RV-Argonaut/main #105
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
name: Run Tests and Release | |
# This workflow is triggered on pushes to the repository. | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
env: | |
NO_COLOR: true | |
CI: 1 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jobs: | |
build: | |
name: Test | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v2 | |
- uses: oven-sh/setup-bun@v1 | |
- name: Turnstyle | |
uses: softprops/turnstyle@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Dependencies | |
run: echo "Installing dependencies" && bun install && echo "Done installing dependencies" | |
- name: Run Types Check | |
run: bun x tsc --noEmit | |
- name: Run Tests | |
run: bun test | |
- name: Release Patch | |
if: endsWith(github.ref, '/main') | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Divyendu Singh" | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc | |
npm version patch | |
bun run build | |
npm publish | |
git push origin main | |
# Note: not 1.0.0 yet, semantic-release only supports versions >1.0.0 | |
# - name: Release | |
# if: endsWith(github.ref, '/main') | |
# run: yarn semantic-release |