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@v6 with: fetch-depth: 10 fetch-tags: true 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