ci: add conventional commits linter (#850) #423
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: Release | |
on: | |
push: | |
branches: | |
- master | |
- next | |
- rc | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: Tag or branch to check out for releasing | |
default: master | |
type: string | |
required: true | |
jobs: | |
release: | |
name: Release / Node ${{ matrix.node }} | |
strategy: | |
matrix: | |
node: ['20'] | |
runs-on: ubuntu-latest | |
steps: | |
- if: ${{ inputs.ref != 'master' }} | |
run: Input ref is ${{ inputs.ref }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.ref || 'master' }} | |
fetch-depth: 0 # Get whole repo with all the information | |
- name: Set up Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: | | |
npm ci | |
npm run build | |
- name: Create a release for @supabase/auth-js | |
run: npx semantic-release -r 'https://github.com/supabase/gotrue-js.git' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish @supabase/gotrue-js | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
if [ "0.0.0" != $(jq -r '.version' package.json) ] | |
then | |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc | |
for f in package.json package-lock.json | |
do | |
sed -i 's|\(["/]\)auth-js|\1gotrue-js|g' "$f" | |
done | |
npm publish --tag latest | |
fi | |