name: Crease release
permissions:
  contents: write
  id-token: write
  pages: write
  pull-requests: write
  checks: write
  statuses: write
  deployments: write
on:
    push:
        tags:
            - "v*.*.*"

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - name: Checkout
              uses: actions/checkout@v4
              
            - name: Set up Go
              uses: actions/setup-go@v4
              
            - name: Set up Node.js
              uses: actions/setup-node@v4
              
            - name: Install Go dependencies
              run: go mod download
              
            - name: Install NPM dependencies
              run: npm ci
              
            - name: Get version
              id: get_version
              run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
              
            - name: Create ZIP archive
              run: zip -r "adritian-free-hugo-theme-${{ steps.get_version.outputs.VERSION }}.zip" . -x "*.git*"
              
            - name: Release
              uses: softprops/action-gh-release@v2
              with:
                generate_release_notes: true
                files: "adritian-free-hugo-theme-${{ steps.get_version.outputs.VERSION }}.zip"
  