From d9a40ad85614d5615b9941463186bbc1ce82a66a Mon Sep 17 00:00:00 2001 From: Josh Willox Date: Sun, 28 Jul 2024 14:07:48 +1000 Subject: [PATCH] ci: add semantic release workflow --- .github/workflows/release.yaml | 35 +++++++++++++++++++++++++--------- package.json | 5 ++--- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a5c5e600..69453769 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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: @@ -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" diff --git a/package.json b/package.json index 1131a857..30ed02c9 100644 --- a/package.json +++ b/package.json @@ -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",