Skip to content

Commit

Permalink
ci: add semantic release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwillox committed Jul 28, 2024
1 parent 451350a commit d9a40ad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
name: "Publish"
name: "Release"

on:
release:
types: [published]
push:
branches:
- "beta"
- "alpha"
workflow_dispatch:
inputs:
draft:
type: boolean
description: "Draft release"
default: false
release_type:
type: choice
description: "Release type"
default: "auto"
options:
- "auto"
- "patch"
- "minor"
- "major"

jobs:
publish:
Expand All @@ -24,11 +41,11 @@ jobs:
- name: "Install dependencies"
run: pnpm install

- name: "Run Build"
run: pnpm run build

- name: "Upload assets"
- name: "Release Package 📦"
run: pnpm dlx @jcwillox/semantic-release-config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} dist/*
SEMANTIC_RELEASE_GITHUB_DRAFT: ${{ inputs.draft }}
SEMANTIC_RELEASE_FORCE_RELEASE: ${{ inputs.release_type }}
SEMANTIC_RELEASE_GITHUB_ASSETS: "dist/*"
SEMANTIC_RELEASE_CMD_PREPARE: "VERSION=${nextRelease.version} pnpm build"
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "canary",
"version": "0-dev",
"author": "Joshua Cowie-Willox",
"license": "MIT",
"version": "0.0.0-dev",
"type": "module",
"private": true,
"scripts": {
"prepare": "husky",
"dev": "vite build --watch",
Expand Down

0 comments on commit d9a40ad

Please sign in to comment.