package.json formated and linted #4
Workflow file for this run
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: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| build-and-release: | |
| name: Build & Publish Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| # ------------------------------ | |
| # Checkout | |
| # ------------------------------ | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # ------------------------------ | |
| # Node Setup | |
| # ------------------------------ | |
| - name: Use Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: yarn | |
| # ------------------------------ | |
| # Install Dependencies | |
| # ------------------------------ | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| # ------------------------------ | |
| # Code Quality Checks | |
| # ------------------------------ | |
| - name: Lint code | |
| run: yarn lint --max-warnings=0 | |
| - name: Check formatting | |
| run: yarn prettier --check . | |
| - name: Type check | |
| run: yarn tsc --noEmit | |
| # ------------------------------ | |
| # Build | |
| # ------------------------------ | |
| - name: Build project | |
| run: yarn build | |
| # ------------------------------ | |
| # Auto Changelog Generation | |
| # ------------------------------ | |
| - name: Install git-cliff | |
| run: | | |
| curl -sSL https://github.com/orhun/git-cliff/releases/latest/download/git-cliff-Linux-x86_64.tar.gz \ | |
| | tar -xz | |
| sudo mv git-cliff /usr/local/bin/ | |
| - name: Generate changelog | |
| run: | | |
| git-cliff --tag ${GITHUB_REF#refs/tags/} > RELEASE_CHANGELOG.md | |
| # ------------------------------ | |
| # Package Release Files | |
| # ------------------------------ | |
| - name: Archive build output | |
| run: | | |
| mkdir -p release | |
| cp -r dist release/ | |
| cp package.json release/ | |
| cp yarn.lock release/ | |
| cp RELEASE_CHANGELOG.md release/ | |
| # ------------------------------ | |
| # Publish GitHub Release | |
| # ------------------------------ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body_path: RELEASE_CHANGELOG.md | |
| files: | | |
| release/** | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |