-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added github actions for publish to s3 and trigger homebrew rel…
…ease (#287) * feat: Added github actions for publish to s3 and trigger homebrew release * Fixing indentation issue * Added change to publish to npm. Added missing repo name * Added trigger to oclif-release workflow in cli. Addressed the review comments. * Added npm token in semantic release * Added release_feature_branch in the prerelease. Co-authored-by: lakshmiravali <lakshmiravali.rimmalapudi@gmail.com>
- Loading branch information
1 parent
ce15661
commit 5d7acd6
Showing
3 changed files
with
86 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Oclif Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
home-brew-branch: | ||
description: 'Run workflow in home brew branch' | ||
default: main | ||
tag-name: | ||
description: 'Tag released recently' | ||
required: true | ||
formula: | ||
description: 'Formula to release in homebrew' | ||
default: twilio | ||
pre-release: | ||
description: 'Homebrew release type' | ||
default: 'false' | ||
jobs: | ||
oclif-release: | ||
name: Publish for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
outputs: | ||
sha256: ${{ steps.sha256.outputs.sha256 }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
asset_name: ${{ github.event.inputs.formula }}-v${{ github.event.inputs.tag-name }} | ||
command_name: npx oclif-dev pack | ||
publish: homebrew | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
npm install | ||
if [ "$RUNNER_OS" == "macOS" ]; then | ||
brew install makensis | ||
fi | ||
${{ matrix.command_name }} | ||
- name: Configure AWS credentials from Test account | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
- name: Publish assests to s3 and calculate sha of oclif dev pack | ||
id: sha256 | ||
if: ${{matrix.publish == 'homebrew'}} | ||
run: | | ||
npx oclif-dev publish | ||
brew install coreutils | ||
echo "::set-output name=sha256::$(sha256sum dist/${{ matrix.asset_name }}/${{ matrix.asset_name }}.tar.gz | awk '{print $1}')" | ||
home-brew-release: | ||
name: Trigger homebrew release workflow | ||
runs-on: ubuntu-latest | ||
needs: [oclif-release] | ||
steps: | ||
- name: Invoke HomeBrew workflow | ||
uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: Homebrew Release | ||
token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
repo: twilio/homebrew-brew | ||
ref: ${{ github.event.inputs.home-brew-branch }} | ||
inputs: '{ "formula": "${{github.event.inputs.formula}}", "version": "${{github.event.inputs.tag-name}}", "sha": "${{needs.oclif-release.outputs.sha256}}", "pre-release": "${{github.event.inputs.pre-release}}" }' |
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