+ Author: TvArticle Team + +
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24c4bf8..fff73f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Publish to npm and GitHub Packages +name: Publish to npm and Deploy on: pull_request: @@ -16,23 +16,35 @@ jobs: actions: write id-token: write packages: write + pull-requests: write + steps: + - name: Generate token from GitHub App + id: generate_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Checkout repository uses: actions/checkout@v4 with: + token: ${{ steps.generate_token.outputs.token }} fetch-depth: 0 + persist-credentials: true - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 20 registry-url: https://registry.npmjs.org/ + cache: 'npm' - name: Install dependencies - run: npm install + run: npm ci - name: Determine version bump - id: version + id: version_type run: | if [[ "${{ github.event.pull_request.title }}" == *"major"* ]]; then echo "BUMP_TYPE=major" >> $GITHUB_ENV @@ -42,16 +54,24 @@ jobs: echo "BUMP_TYPE=patch" >> $GITHUB_ENV fi - - name: Bump version and push tag + - name: Configure Git + run: | + git config user.name "TODOvue-release-bot[bot]" + git config user.email "TODOvue-release-bot[bot]@users.noreply.github.com" + git config url."https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/".insteadOf "https://github.com/" + + - name: Bump version and push + id: bump run: | - git config --global user.name "github-actions" - git config --global user.email "actions@github.com" - npm version $BUMP_TYPE --no-git-tag-version - git commit -am "chore(release): 🔥 v$(node -p "require('./package.json').version")" - git tag v$(node -p "require('./package.json').version") - git push origin main --tags + npm version $BUMP_TYPE -m "chore(release): 🔥 v%s [skip ci]" + NEW_VERSION=$(node -p "require('./package.json').version") + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT + git push origin main --follow-tags env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_AUTHOR_NAME: "TODOvue-release-bot[bot]" + GIT_AUTHOR_EMAIL: "TODOvue-release-bot[bot]@users.noreply.github.com" + GIT_COMMITTER_NAME: "TODOvue-release-bot[bot]" + GIT_COMMITTER_EMAIL: "TODOvue-release-bot[bot]@users.noreply.github.com" - name: Build package run: npm run build @@ -61,22 +81,25 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Setup Node.js for GitHub Packages - uses: actions/setup-node@v4 + - name: Create GitHub Release + uses: actions/github-script@v7 with: - node-version: 20 - registry-url: https://npm.pkg.github.com - scope: '@todovue' - - - name: Publish to GitHub Packages - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ steps.generate_token.outputs.token }} + script: | + await github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: `v${{ steps.bump.outputs.NEW_VERSION }}`, + name: `v${{ steps.bump.outputs.NEW_VERSION }}`, + body: 'For stable releases, please refer to [CHANGELOG.md](https://github.com/TODOvue/tv-demo/blob/main/CHANGELOG.md) for details.', + draft: false, + prerelease: false + }); - name: Build Demo Website run: npm run build:demo - - name: Deploy Demo to FTP + - name: Deploy TODOvue UI uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: server: ${{ secrets.FTP_SERVER }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1435f8c..ef62b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,8 @@ All notable changes to `@todovue/tv-ui` will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.0] - 2026-01-27 + +### Added +- Initial release of `@todovue/tv-ui`. diff --git a/README.md b/README.md index a532024..892f2e9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,207 @@
+
