Skip to content

Instantly share code, notes, and snippets.

@enzolutions
Forked from jmolivas/readme.md
Last active June 10, 2019 22:20
Show Gist options
  • Save enzolutions/83f4ec5f0ee5461b6f8047f52641e591 to your computer and use it in GitHub Desktop.
Save enzolutions/83f4ec5f0ee5461b6f8047f52641e591 to your computer and use it in GitHub Desktop.
Automate DrupalConsole release process

Automate DrupalConsole release process

This script run the following tasks on multiple repos from the CLI.

  • Creates a new tag.
  • Push new created tag.
  • Create a new release.
  • Build the phar file. (only for drupal-console-launcher)
  • Upload the phar file (only for drupal-console-launcher)

To execute this proces is required to install

Generate token for Github Release

export GITHUB_TOKEN="d45baba4e7d79cf345e8d294a1eac9148b4d7a76"
drupal version:new --directory="/Users/enzo/www/DrupalConsoleRepositories" --tag="1.9.0"
command:
name: version:new
description: 'Create new Drupal Console version'
commands:
# Create tag & release drupal-console-extend
- command: exec
arguments:
bin: drupal version:tag:release --directory="%{{directory}}/drupal-console-extend" --tag="%{{tag}}" --repo="drupal-console-extend"
options:
working-directory: "%{{directory}}/drupal-console-extend"
# Create tag & release drupal-console-en
- command: exec
arguments:
bin: drupal version:tag:release --directory="%{{directory}}/drupal-console-en" --tag="%{{tag}}" --repo="drupal-console-en"
options:
working-directory: "%{{directory}}/drupal-console-en"
# Create tag & release drupal-console-core
- command: exec
arguments:
bin: drupal version:tag:release --directory="%{{directory}}/drupal-console-core" --tag="%{{tag}}" --repo="drupal-console-core"
options:
working-directory: "%{{directory}}/drupal-console-core"
# Create tag & release drupal-console
- command: exec
arguments:
bin: drupal version:tag:release --directory="%{{directory}}/drupal-console" --tag="%{{tag}}" --repo="drupal-console"
options:
working-directory: "%{{directory}}/drupal-console"
# Create tag & release drupal-console-launcher
- command: exec
arguments:
bin: drupal version:tag:release --directory="%{{directory}}/drupal-console-launcher" --tag="%{{tag}}" --repo="drupal-console-launcher"
options:
working-directory: "%{{directory}}/drupal-console-launcher"
# Create drupal.phar
- command: exec
arguments:
bin: box build
options:
working-directory: "%{{directory}}/drupal-console-launcher"
# Create shasum
- command: exec
arguments:
bin: shasum drupal.phar | awk '{print $1}' > drupal.phar.version
options:
working-directory: "%{{directory}}/drupal-console-launcher"
# Upload phar
- command: exec
arguments:
bin: github-release upload --user enzolutions --repo drupal-console-extend --tag %{{tag}} --name "drupal.phar" --file drupal.phar
options:
working-directory: "%{{directory}}/drupal-console-launcher"
# Upload shasum
- command: exec
arguments:
bin: github-release upload --user enzolutions --repo drupal-console-extend --tag %{{tag}} --name "drupal.phar.version" --file drupal.phar.version
options:
working-directory: "%{{directory}}/drupal-console-launcher"
command:
name: version:tag:release
description: 'Create new Drupal Console tag and release'
commands:
# Create tag
- command: exec
arguments:
bin: git tag %{{tag}}
options:
working-directory: "%{{directory}}"
# Push tag
- command: exec
arguments:
bin: git push upstream --tags
options:
working-directory: "%{{directory}}"
# Create release
- command: exec
arguments:
bin: github-release release --user enzolutions --repo %{{repo}} --tag %{{tag}} --name "v%{{tag}}" --description ""
options:
working-directory: "%{{directory}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment