Build: @v1.0.0 #7
Workflow file for this run
This file contains 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: Build | |
run-name: 'Build: @${{ github.ref_name }}' | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com' | |
GH_USER: 'github-actions[bot]' | |
jobs: | |
build: | |
name: Build applications | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/[email protected] | |
- name: Setup node (20.x) | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Publish | |
run: pnpm publish --provenance --no-git-checks --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
coverage: | |
name: Upload the coverage | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/[email protected] | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run the coverage | |
run: pnpm run coverage | |
- uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/coverage-final.json | |
verbose: true | |
create-release: | |
needs: | |
- build | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/[email protected] | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Generate changelog | |
run: | | |
pnpm run changelog -c cliff-github.toml | |
pnpm exec prettier --write CHANGELOG.md | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: ${{ github.ref_name }} | |
draft: true | |
prerelease: false | |
body_path: CHANGELOG.md |