name: Create Release

on:
  push:
    branches:
      - main

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 21

      - name: Install dependencies
        run: npm install

      - name: Run semantic-release
        id: release
        run: npm run semantic-release
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}