diff --git a/.github/workflows/build-production-release.yml b/.github/workflows/build-production-release.yml new file mode 100644 index 00000000..ac6188df --- /dev/null +++ b/.github/workflows/build-production-release.yml @@ -0,0 +1,60 @@ +name: Build Production & Release + +on: + release: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + + - name: Setup composer + run: composer setup + + - name: Setup Node.js 18.15.0 + uses: actions/setup-node@v2 + with: + node-version: "18.15.0" + + - name: Install yarn globally + run: npm install --global yarn + + - name: Install yarn dependencies + run: yarn install + + - name: Compile Scripts + run: yarn minify + + - name: Fix Text Domain + run: yarn fixtextdomain + + - name: Generate Text Domain POT file + run: composer make-production-pot + + - name: Remove Composer Dev Dependencies + run: composer build + + - name: Build plugin + run: yarn git-compress + + - name: Create zip file + run: | + tag_name=$(git describe --tags --abbrev=0) + zip -r "templatiq.${tag_name}.zip" templatiq + + - name: Upload zip file as a release asset + uses: softprops/action-gh-release@v1 + with: + files: templatiq*.zip + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} diff --git a/.github/workflows/deploy-to-staging.yml b/.github/workflows/deploy-to-staging.yml index 34b80372..3f3bfb61 100644 --- a/.github/workflows/deploy-to-staging.yml +++ b/.github/workflows/deploy-to-staging.yml @@ -13,12 +13,12 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Set up PHP + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '7.4' - - name: Setup composer + - name: Setup Composer run: composer setup - name: Setup Node.js 18.15.0 @@ -38,13 +38,10 @@ jobs: - name: Fix Text Domain run: yarn fixtextdomain - - name: Generate Text Domain POT file - run: composer make-unminified-pot - - name: Remove Composer Dev Dependencies run: composer build - - name: 📂 Sync files + - name: 📂 Sync Files - FTP Deploy uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: server: ${{ secrets.ftp_staging_server }} @@ -52,6 +49,7 @@ jobs: password: ${{ secrets.ftp_staging_password }} port: 21 exclude: | + src/** node_modules/** resources/js/** resources/svg/** diff --git a/composer.json b/composer.json index cfa12fd8..e200ccb4 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,13 @@ }, "scripts": { "build": [ - "composer -d vendor --no-plugins --no-interaction install --no-scripts --no-dev" + "composer -d . --no-plugins --no-interaction install --no-scripts --no-dev" ], "format": "vendor/bin/phpcbf --standard=phpcs.xml", - "phpcs": "vendor/bin/phpcs --standard=phpcs.xml" + "phpcs": "vendor/bin/phpcs --standard=phpcs.xml", + "setup": [ + "composer install --no-cache" + ] }, "config": { "allow-plugins": { diff --git a/src/js/modules/Signin/SignInContent.js b/src/js/modules/SignIn/SignInContent.js similarity index 100% rename from src/js/modules/Signin/SignInContent.js rename to src/js/modules/SignIn/SignInContent.js diff --git a/src/js/modules/Signin/index.js b/src/js/modules/SignIn/index.js similarity index 100% rename from src/js/modules/Signin/index.js rename to src/js/modules/SignIn/index.js diff --git a/src/js/modules/Signup/SignUpContent.js b/src/js/modules/SignUp/SignUpContent.js similarity index 100% rename from src/js/modules/Signup/SignUpContent.js rename to src/js/modules/SignUp/SignUpContent.js diff --git a/src/js/modules/Signup/index.js b/src/js/modules/SignUp/index.js similarity index 100% rename from src/js/modules/Signup/index.js rename to src/js/modules/SignUp/index.js