Skip to content

Commit

Permalink
ci: update release configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard committed Sep 7, 2022
1 parent 65fb2d8 commit d85d891
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 32 deletions.
35 changes: 4 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ name: CI & Release

on:
push:
workflow_dispatch:
inputs:
release:
description: "Release new version"
required: true
default: false
type: boolean
pull_request:
branches:
- next

jobs:
test:
Expand All @@ -30,33 +26,10 @@ jobs:
- run: pnpm run build
- run: pnpm test

prelease:
name: "Semantic release (prerelease)"
needs: test
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
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/*
- run: npm i pnpm@latest -g
- run: pnpm 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 }}

release:
name: "Semantic release (latest)"
name: "Semantic release"
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && inputs.release == true
steps:
- uses: actions/checkout@v3
with:
Expand Down
8 changes: 7 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"extends": "@sanity/semantic-release-preset",
"branches": ["main", "next"]
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
{"name": "beta", "prerelease": true},
{"name": "alpha", "prerelease": true}
]
}

0 comments on commit d85d891

Please sign in to comment.