forked from saadeghi/daisyui
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (77 loc) · 2.24 KB
/
release-new-version.yml
File metadata and controls
90 lines (77 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "🎉 Release new version"
on:
workflow_dispatch:
inputs:
release-type:
type: choice
description: Release type
options:
- "--release-as patch"
- "--release-as minor"
push:
branches:
- master
paths:
- "packages/daisyui/**"
jobs:
run-tests:
name: 🧪 Tests
uses: ./.github/workflows/run-tests.yml
secrets: inherit
with:
filter: ""
build-publish:
name: 🔨 Build + 🚀 Publish
needs: run-tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
clean: false
ref: master
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun i
- name: Build package
run: bun run --bun build
- name: Config Git
run: |
git config --local user.email "pouya.saadeghi@gmail.com"
git config --local user.name "Pouya Saadeghi"
- name: Run release command
run: |
# git add --all packages/bundle/
cd packages/daisyui
bunx commit-and-tag-version --commit-all --infile ../../CHANGELOG.md ${{ inputs.release-type }}
- name: Read package version from package.json
id: package-version
run: |
version=$(grep -o '"version": *"[^"]*"' packages/daisyui/package.json | cut -d'"' -f4)
echo version=$version >> $GITHUB_OUTPUT
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package to NPM
if: github.repository == 'saadeghi/daisyui'
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > ~/.npmrc
cd packages/daisyui
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_LOGLEVEL: verbose
deploy-docs:
name: 📘 Docs
needs: build-publish
uses: ./.github/workflows/deploy-docs.yml
secrets: inherit
write-release-notes:
name: 📝 Release notes
needs: deploy-docs
uses: ./.github/workflows/write-release-notes.yml
secrets: inherit