chore: create github release on new version #2
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install packages | |
run: bun i | |
- name: Check code coverage | |
run: bun run coverage | |
bump-version: | |
needs: coverage | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set git email | |
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Set git name | |
run: git config --global user.name "github-actions[bot]" | |
- name: Install bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install packages | |
run: bun i | |
- name: Build library and CLI | |
run: bun run build | |
- name: Bump package version | |
run: npx standard-version | |
- name: Push changes | |
run: git push --follow-tags origin main | |
- name: Update CHANGELOG | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ github.token }} | |
tag: ${{ github.ref_name }} | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
allowUpdates: true | |
draft: false | |
makeLatest: true | |
name: ${{ github.ref_name }} | |
body: ${{ steps.changelog.outputs.changes }} | |
token: ${{ github.token }} |