-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' of github.com:Automattic/WP-Job-Manager into fea…
…ture/promoted-jobs
- Loading branch information
Showing
20 changed files
with
2,221 additions
and
169 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,54 @@ | ||
name: Plugin Build | ||
|
||
on: pull_request | ||
on: | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
name: Plugin Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
tools: composer | ||
coverage: none | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install JS dependencies | ||
run: npm ci | ||
- name: Install PHP dependencies | ||
run: composer install --no-ansi --no-interaction --prefer-dist --no-progress | ||
- name: Build Plugin | ||
run: npm run build | ||
- name: Decompress plugin | ||
run: unzip wp-job-manager.zip -d wp-job-manager | ||
- name: Store Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wp-job-manager-${{ github.event.pull_request.head.sha }} | ||
path: ${{ github.workspace }}/wp-job-manager/ | ||
retention-days: 7 | ||
|
||
build: | ||
name: Plugin Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
tools: composer | ||
coverage: none | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install JS dependencies | ||
run: npm ci | ||
- name: Install PHP dependencies | ||
run: composer install --no-ansi --no-interaction --prefer-dist --no-progress | ||
- name: Build Plugin | ||
run: npm run build | ||
- name: Decompress plugin | ||
run: unzip wp-job-manager.zip -d wp-job-manager | ||
- name: Store Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wp-job-manager-${{ github.event.pull_request.head.sha }} | ||
path: ${{ github.workspace }}/wp-job-manager/ | ||
retention-days: 7 | ||
- name: Save plugin zip and add link to the PR description | ||
env: | ||
WPJMCOM_API_LOGIN: ${{ secrets.WPJMCOM_API_LOGIN }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: node scripts/upload-and-link-plugin-zip.mjs --pr ${{ github.event.number }} --commit ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.merged && '--merged' || '' }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Create Plugin Release | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- 'trunk' | ||
|
||
jobs: | ||
deploy: | ||
if: github.event.pull_request.merged == true && startsWith( github.head_ref, 'release/' ) | ||
runs-on: ubuntu-latest | ||
name: WPJM Release | ||
steps: | ||
- name: Comment on PR | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: gh pr comment ${{ github.event.number }} --body "🚀 Starting release ..." | ||
- uses: actions/checkout@v2 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
tools: composer | ||
coverage: none | ||
- name: Install JS dependencies | ||
run: npm ci | ||
- name: Install PHP dependencies | ||
run: composer install --no-ansi --no-interaction --prefer-dist --no-progress | ||
- name: Setup Git | ||
run: | | ||
git config user.name "WPJM Bot" | ||
git config user.email "<robot@wpjobmanager.com>" | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
node scripts/create-release.mjs wp-job-manager ${{ github.event.number }} | ||
unzip -q wp-job-manager.zip | ||
- name: Deploy to WordPress.org | ||
uses: 10up/action-wordpress-plugin-deploy@abb939a0d0bfd01063e8d1933833209201557381 | ||
env: | ||
SVN_PASSWORD: ${{ secrets.WORDPRESSORG_SVN_PASSWORD }} | ||
SVN_USERNAME: ${{ secrets.WORDPRESSORG_SVN_USERNAME }} | ||
BUILD_DIR: wp-job-manager | ||
SLUG: wp-job-manager | ||
- name: Comment on PR | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: gh pr comment ${{ github.event.number }} --body "✅ Release ${{ github.event.release.tag_name }} deployed to WordPress.org" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
/* global job_manager_datepicker */ | ||
jQuery(document).ready(function($) { | ||
jQuery(document).ready( function() { | ||
var datePickerOptions = { | ||
altFormat : 'yy-mm-dd', | ||
}; | ||
|
||
if ( typeof job_manager_datepicker !== 'undefined' ) { | ||
datePickerOptions.dateFormat = job_manager_datepicker.date_format; | ||
} | ||
|
||
$( 'input.job-manager-datepicker, input#_job_expires' ).each( function(){ | ||
var $hidden_input = $( '<input />', { type: 'hidden', name: $(this).attr( 'name' ) } ).insertAfter( $( this ) ); | ||
$(this).attr( 'name', $(this).attr( 'name' ) + '-datepicker' ); | ||
$(this).keyup( function() { | ||
if ( '' === $(this).val() ) { | ||
var initializeDatepicker = function ( targetInput ) { | ||
var $target = jQuery( targetInput ); | ||
var $hidden_input = jQuery( '<input />', { type: 'hidden', name: $target.attr( 'name' ) } ).insertAfter( $target ); | ||
|
||
$target.attr( 'name', $target.attr( 'name' ) + '-datepicker' ); | ||
$target.on( 'keyup', function() { | ||
if ( '' === $target.val() ) { | ||
$hidden_input.val( '' ); | ||
} | ||
} ); | ||
$(this).datepicker( $.extend( {}, datePickerOptions, { altField: $hidden_input } ) ); | ||
if ( $(this).val() ) { | ||
var dateParts = $(this).val().split("-"); | ||
$target.datepicker( jQuery.extend( {}, datePickerOptions, { altField: $hidden_input } ) ); | ||
if ( $target.val() ) { | ||
var dateParts = $target.val().split('-'); | ||
if ( 3 === dateParts.length ) { | ||
var selectedDate = new Date(parseInt(dateParts[0], 10), (parseInt(dateParts[1], 10) - 1), parseInt(dateParts[2], 10)); | ||
$(this).datepicker('setDate', selectedDate); | ||
$target.datepicker('setDate', selectedDate); | ||
} | ||
} | ||
}; | ||
|
||
jQuery( 'input.job-manager-datepicker, input#_job_expires' ).each( function() { | ||
initializeDatepicker( this ); | ||
} ); | ||
|
||
|
||
jQuery( document ).on( 'wpJobManagerFieldAdded', function ( e ) { | ||
initializeDatepicker( e.target ); | ||
}); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.