Skip to content

Commit

Permalink
chore: add deploy steps to build library release artifacts (#151)
Browse files Browse the repository at this point in the history
Co-authored-by: ahung <[email protected]>
  • Loading branch information
Hunga1 and Hunga1 authored Feb 4, 2022
1 parent b77574d commit 9abd236
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,19 @@ jobs:
- name: Checkout php-http-client
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: '7.4'
id: php

- name: Build Release Artifacts
run: make bundle

- name: Create GitHub Release
uses: sendgrid/dx-automator/actions/release@main
with:
assets: php-http-client.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -68,7 +79,7 @@ jobs:
env:
SLACK_COLOR: failure
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Tests *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
SLACK_TITLE: Action Failure - ${{ github.repository }}
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ vendor/
.php_cs
.php_cs.cache
phpunit.xml

# Build artifacts
php-http-client.zip
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
.PHONY: clean install test

clean:
@rm -rf vendor composer.lock
@rm -rf vendor composer.lock php-http-client.zip

ci-install: clean
composer install --no-dev

install: clean
composer install --no-suggest --no-scripts --no-progress --no-interaction

test: install
vendor/bin/phpunit test/unit

bundle: ci-install
zip -r php-http-client.zip . -x \*.git\* \*composer.json\* \*test\*

0 comments on commit 9abd236

Please sign in to comment.