diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..4cf3501 --- /dev/null +++ b/.distignore @@ -0,0 +1,8 @@ +.distignore +.git +.gitignore +.travis.yml +.dev +package.json +node_modules +Gruntfile.js diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b36444d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +sudo: false + +language: + - php + - node_js + +before_script: + - curl -s https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar > /tmp/wp-cli.phar + +script: + - echo "Deploy only" + +before_deploy: + - export RELEASE_FOLDER=lyrical + - php /tmp/wp-cli.phar package install runcommand/dist-archive + - cp -rv ${TRAVIS_BUILD_DIR} /tmp/${RELEASE_FOLDER} + - mv /tmp/${RELEASE_FOLDER} ${TRAVIS_BUILD_DIR} + - php /tmp/wp-cli.phar dist-archive ${RELEASE_FOLDER} ${TRAVIS_BUILD_DIR}/${RELEASE_FOLDER}.zip --format=zip --debug + + +deploy: + provider: releases + api_key: + secure: HXg/IrminkVwGo3t+UotDwth6Zg1/YQAr1hWbX2TFVSucrUIm7gT76q6SrQ9rN4mdtc+m6YSNCgc+MV6I3KE1uxDLp7Gwv7CU0DK9AsdXualmc1/LMd3U2Mui5Pz0tpomFWBUh/UjrVHfCejBiPz+WqkiGIakYxm+5jU/mZGXqsjjYIfi0JBP+7QWUe36RcS9HMf4nCX53lHNJaDmGTVA4PLNWixOMetgy/txT0JjypkvSWPwUlTPZounILr+fhHWp9LxPB+E2+2FMUhTyTJ/rCNrTdOe49QofKrJ3mX91CmHkTWK1eRi9I8onPDPf/Tf5OA9qK1VbYDHD1B5QZcjfheE/x+KwNSE/+ul4irk9z/avTlj8Mg4kfjv3nsi4YhWKgML1mj8WN3I7wNzM46rNn+JNIdQjdcVQVMTcremAGhzDWH1SpPtxPU2IQMovi7h8OsJJHvEbJO3TDHT5KB2VBCSx1ww/qHn/pjZUGHfTf4e2nXNP/wr0W3WrOegNVktEPRDhA5rMH2GlVpyMkTl5lnHXSnSktdvGmqlnbUu76PR6sHZbuMpteVUy56xvQLPsCsNgS7jFnu4KhVdaZUrGlxudH5jpBBIpGAUNlfgjTWtdW/QA5JnxREzsxTgXLPkQbN3KoinOfUMQ8zWSoBoefx+pyUsejPJ7O+nu6AI8A= + file: lyrical.zip + on: + tags: true + repo: godaddy/wp-lyrical-theme + skip_cleanup: true + overwrite: true diff --git a/Gruntfile.js b/Gruntfile.js index 42bf57c..9758059 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -64,6 +64,48 @@ module.exports = function( grunt ) { files: '.dev/sass/**/*.scss', tasks: [ 'sass','autoprefixer','cssjanus' ] } + }, + + replace: { + version_php: { + src: [ + '**/*.php', + '.dev/**/*.scss' + ], + overwrite: true, + replacements: [ { + from: /Version:(\s*?)[a-zA-Z0-9\.\-\+]+$/m, + to: 'Version:$1' + pkg.version + }, { + from: /@version(\s*?)[a-zA-Z0-9\.\-\+]+$/m, + to: '@version$1' + pkg.version + }, { + from: /@since(.*?)NEXT/mg, + to: '@since$1' + pkg.version + }, { + from: /VERSION(\s*?)=(\s*?['"])[a-zA-Z0-9\.\-\+]+/mg, + to: 'VERSION$1=$2' + pkg.version + }, { + from: /'PRIMER_CHILD_VERSION', '[a-zA-Z0-9\.\-\+]+'/mg, + to: '\'PRIMER_CHILD_VERSION\', \'' + pkg.version + '\'' + }] + }, + version_readme: { + src: 'readme.*', + overwrite: true, + replacements: [ { + from: /^(\*\*|)Stable tag:(\*\*|)(\s*?)[a-zA-Z0-9.-]+(\s*?)$/mi, + to: '$1Stable tag:$2$3<%= pkg.version %>$4' + } ] + }, + pot:{ + src: 'languages/' + pkg.name + '.pot', + overwrite: true, + replacements: [ { + from: 'charset=CHARSET', + to: 'charset=UTF-8' + } ] + } } }); @@ -71,5 +113,6 @@ module.exports = function( grunt ) { require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks ); grunt.registerTask( 'default', [ 'sass', 'autoprefixer', 'cssjanus' ] ); + grunt.registerTask( 'version', [ 'replace' ] ); }; diff --git a/package.json b/package.json index ae6eb2c..40883e1 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,6 @@ "bugs": { "url": "https://github.com/godaddy/wp-lyrical-theme/issues" }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "devDependencies": { "grunt": "~0.4.5", "grunt-autoprefixer": "~3.0.4", @@ -20,7 +17,12 @@ "grunt-cssjanus": "~0.3.2", "grunt-dev-update": "~2.0.0", "grunt-sass": "^1.2.0", + "grunt-text-replace": "^0.4.0", "load-grunt-tasks": "~3.5.0", "matchdep": "~1.0.1" + }, + "scripts": { + "version": "grunt version && grunt && git add -A .", + "postversion": "git push && git push --tags" } }