Skip to content

Commit

Permalink
fix: setup @sanity/semantic-release-preset
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Aug 17, 2022
1 parent 475fff2 commit 751bdbc
Show file tree
Hide file tree
Showing 5 changed files with 724 additions and 365 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: CI
name: CI & Release
on:
- push
- pull_request
push:
workflow_dispatch:
inputs:
release:
description: 'Release new version'
required: true
default: false
type: boolean
jobs:
test:
runs-on: ${{ matrix.platform }}
Expand All @@ -10,8 +16,7 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest]
node-version:
- 16
node-version: [lts/*, current]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -21,3 +26,25 @@ jobs:
- run: npm run lint
- run: npm run build
- run: npm test

release:
name: 'Semantic release'
needs: test
runs-on: ubuntu-latest
if: inputs.release == true
steps:
- uses: actions/checkout@v3
with:
# Need to fetch entire commit history to
# analyze every commit since last release
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'npm'
- run: npm install
# Branches that will release new versions are defined in .releaserc.json
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
4 changes: 4 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@sanity/semantic-release-preset",
"branches": ["main"]
}
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
The MIT License (MIT)

Copyright (c) 2020 Espen Hovlandsdal
Copyright (c) 2022 Sanity.io

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down

0 comments on commit 751bdbc

Please sign in to comment.