Bit Integrations v2.6.1 #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to WordPress.org Repository | |
| on: | |
| push: | |
| branches: | |
| - release | |
| release: | |
| types: [released] | |
| jobs: | |
| deploy_to_wp_repository: | |
| name: Deploy to WP.org | |
| runs-on: ubuntu-latest | |
| env: | |
| PLUGIN_SLUG: bit-integrations | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| run_install: false | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| cache-dependency-path: "frontend-dev/pnpm-lock.yaml" | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v3 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install frontend dependencies | |
| run: | | |
| cd frontend-dev | |
| pnpm install | |
| - name: Check for SVN | |
| id: check_svn | |
| run: | | |
| if ! command -v svn &> /dev/null; then | |
| echo "SVN not found, installing..." | |
| sudo apt-get update | |
| sudo apt-get install -y subversion | |
| else | |
| echo "SVN is already installed." | |
| fi | |
| - name: Setup PHP | |
| id: setup-php | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.x" | |
| tools: composer:v2, wp-cli | |
| - name: Determine if this is a release or push | |
| id: set-test-action | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| echo "TEST_ACTION=false" >> $GITHUB_ENV | |
| else | |
| echo "TEST_ACTION=true" >> $GITHUB_ENV | |
| fi | |
| - name: Build | |
| id: build-plugin | |
| run: | | |
| bash .github/build | |
| if [ -d "${{ github.workspace }}/build/${{ env.PLUGIN_SLUG }}" ]; then | |
| echo "free_exists=true" >> "${GITHUB_OUTPUT}" | |
| else | |
| echo "free_exists=false" >> "${GITHUB_OUTPUT}" | |
| fi | |
| - name: WordPress Plugin Deploy | |
| if: steps.build-plugin.outputs.free_exists == 'true' | |
| id: deploy | |
| uses: 10up/action-wordpress-plugin-deploy@stable | |
| with: | |
| generate-zip: true | |
| dry-run: ${{ env.TEST_ACTION }} | |
| env: | |
| SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
| SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
| BUILD_DIR: "${{ github.workspace }}/build/${{ env.PLUGIN_SLUG }}" | |
| SLUG: ${{ env.PLUGIN_SLUG }} | |
| - name: Upload release asset | |
| if: steps.build-plugin.outputs.free_exists == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: ${{ steps.deploy.outputs['zip-path'] }} |