chore: update readme #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [master, beta] | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: false | |
| token: ${{ secrets.GH_TOKEN || github.token }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build library | |
| run: pnpm build:lib | |
| - name: Build demo | |
| run: pnpm build:demo | |
| - name: Prepare for semantic release | |
| run: | | |
| cp .git dist/ngx-timeago/ -r | |
| cp README.md dist/ngx-timeago/ | |
| cp .releaserc.json dist/ngx-timeago/ | |
| - name: Semantic Release | |
| run: | | |
| cd dist/ngx-timeago | |
| pnpm dlx semantic-release | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Deploy to GitHub Pages | |
| if: github.ref == 'refs/heads/master' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| cname: false |