chore(main): release 1.2.0 (#3) #13
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: π€ΉββοΈ Continuous Integration | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [22] | |
name: ποΈ Build | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
- name: π¦ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: π Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
- name: π΅ Cache bun | |
uses: actions/cache@v4 | |
id: cache-bun | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-bun-${{ matrix.node-version }}-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun-${{ matrix.node-version }}- | |
${{ runner.os }}-bun- | |
${{ runner.os }}- | |
- name: π½ Install Dependencies | |
run: bun install | |
- name: π·ββοΈ Build | |
run: bun run build | |
- name: π Upload Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kmitl-wizard | |
path: dist/* | |
release: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [22] | |
if: ${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]') }} | |
needs: build | |
name: π Release | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π€ Automated Release | |
uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: node | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
- name: π Download Build Artifact | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/download-artifact@v4 | |
with: | |
name: kmitl-wizard | |
path: dist/ | |
- name: π·οΈ Tag stable versions | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" | |
git tag -d stable || true | |
git push origin :stable || true | |
git tag -a stable -m "chore: release stable version ${{ steps.release.outputs.tag_name }}" | |
- name: π Upload Release Artifact | |
if: ${{ steps.release.outputs.release_created }} | |
run: gh release upload ${{ steps.release.outputs.tag_name }} dist/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |