name: Semver
on: 
  push:
    branches:
      - "**"
jobs:
  semver:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Enable Corepack
      run: corepack enable
    - name: Setup Node
      uses: actions/setup-node@v4
      with:
        node-version: "21"
    - name: Setup Yarn
      run: |
        yarn set version canary
        yarn config set nodeLinker node-modules
    
    - name: yarn install
      run: yarn install --immutable
    - name: Semantic Release
      id: semantic
      run: yarn run semantic-release
    - name: Create Release
      uses: actions/forgejo-release@v1
      with: 
        direction: upload
        release-dir: src
        release-notes: ${{ steps.semantic.outputs.RELEASE.notes }}
        token: ${{secrets.FIXBLUESKY_RELEASE_TOKEN}}
        tag: ${{steps.semantic.outputs.RELEASE.version}}
        title: ${{steps.semantic.outputs.RELEASE.version}}
