visavi/rotor

View on GitHub
.github/workflows/create-release.yml

Summary

Maintainability
Test Coverage
name: Build release
on:
  release:
    types:
      - created

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.1'

      - name: Move .env file
        run: mv .env.example .env

      - name: Install Composer dependencies
        run: composer install --no-dev -o --prefer-dist --ignore-platform-reqs

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 18
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Build and run production scripts
        run: npm run prod

      - name: Clear vendor
        run: php vendor/bin/cleanup

      - name: Create Archive
        run: zip -r release.zip . -x .git/\* -x node_modules/\* -x tests/\*

      - name: Upload binaries to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: release.zip
          asset_name: rotor-release-$tag.zip
          tag: ${{ github.ref }}