Permalink
Browse files

Automatic releases

  • Loading branch information...
1 parent e2b4e2d commit acae58ea06c6611c3d5dcb387293a00848e29fa1 @jonathanbardo jonathanbardo committed Oct 13, 2016
Showing with 68 additions and 3 deletions.
  1. +10 −0 .distignore
  2. +18 −0 .travis.yml
  3. +35 −0 Gruntfile.js
  4. +5 −3 package.json
View
@@ -0,0 +1,10 @@
+.distignore
+.git
+.gitignore
+.gitmodules
+.travis.yml
+.dev
+package.json
+node_modules
+Gruntfile.js
+readme.md
View
@@ -30,3 +30,21 @@ script:
after_script:
- source $DEV_LIB_PATH/travis.after_script.sh
+
+before_deploy:
+ - export RELEASE_FOLDER=activation
+ - 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: nZeGCRawe6Vh/D6Cll8Egu1oRCpB14x4w1G35yfYrjWqL7Hak+C5+Se4TziTX2RudQX0JV7jlaydqKSrNaChlLkIrAd2DUt8SRgZrWuh18VXFVcOM6gWEvDBdiHOdN7TMlkFM6a3VM3aiMpZqsNbYF4GrMYeZ6coJMdV6Sy6eLpux8hPNbK17fKmdBW+oZor54/arLV9gdPmfPGq/lcdC2/hk9BMOlwZ0dpqH7kS27PDF4gmIVUCgIq+zg4SLqWGMsaZaDzygjBPjL6CKz9ZT+MswplWtz6QTIPfvJVm4tLip9wa9HMv65COo7L1j/1fXwakC4VCGIpGy1m/cDqnL37gAF1wQZXXGrV9JPG7PpOGyNahQZwPoYY8OUJCB+k9AmEwg6s9oBRWFBcY9PQW9sMH5UEGIXerqWfETy7qxGUqKElxogEnYKB/m/YzFhfw72Ew9Ra+AdMjgZOE+KoPo57AYQgbOw1WtPxQDqbWFCuennw2eD+l8WVWGogKEB6f8q0QnzpP+3mjxoSV99nx0sv126YowCrK0r2o5HOztPXp7ArtC3fZWdlGnjx/XWHfwlv75YnI71gD413ffGUXtk4xsCbD3vNOChBlAVphQfJcTscfUDknJFaCB7w7V8pyPXKTuRirBxtSQjddFG21zAOELDZntBgPZ/0Ixu9VJmA=
+ file: primer.zip
+ on:
+ tags: true
+ repo: godaddy/wp-primer-theme
+ skip_cleanup: true
+ overwrite: true
View
@@ -199,6 +199,40 @@ module.exports = function( grunt ) {
interrupt: true
}
}
+ },
+
+ 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_VERSION', '[a-zA-Z0-9\.\-\+]+'/mg,
+ to: '\'PRIMER_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'
+ } ]
+ }
}
});
@@ -209,5 +243,6 @@ module.exports = function( grunt ) {
grunt.registerTask( 'lint', [ 'jshint' ] );
grunt.registerTask( 'update-pot', [ 'makepot' ] );
grunt.registerTask( 'update-mo', [ 'po2mo', 'copy:mo', 'clean:mo' ] );
+ grunt.registerTask( 'version', [ 'replace' ] );
};
View
@@ -10,9 +10,6 @@
"bugs": {
"url": "https://github.com/godaddy/wp-primer-theme/issues"
},
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
"devDependencies": {
"grunt": "~0.4.5",
"grunt-autoprefixer": "~3.0.4",
@@ -27,9 +24,14 @@
"grunt-dev-update": "~2.0.0",
"grunt-po2mo": "~0.1.2",
"grunt-sass": "1.2.0",
+ "grunt-text-replace": "^0.4.0",
"grunt-wp-i18n": "~0.5.4",
"load-grunt-tasks": "~3.5.0",
"matchdep": "~1.0.1",
"susy": "~2.2.12"
+ },
+ "scripts": {
+ "version": "grunt version && grunt && git add -A .",
+ "postversion": "git push && git push --tags"
}
}

0 comments on commit acae58e

Please sign in to comment.