Skip to content

Commit

Permalink
Merge pull request #59 from sovware/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
HeyMehedi authored Feb 20, 2024
2 parents 61a0314 + f07fca4 commit 328ac03
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 8 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build-production-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 4 additions & 6 deletions .github/workflows/deploy-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,20 +38,18 @@ 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/[email protected]
with:
server: ${{ secrets.ftp_staging_server }}
username: ${{ secrets.ftp_staging_username }}
password: ${{ secrets.ftp_staging_password }}
port: 21
exclude: |
src/**
node_modules/**
resources/js/**
resources/svg/**
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 328ac03

Please sign in to comment.