Skip to content

Commit

Permalink
chore: Replaced the community actions with the scripts (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravali-rimmalapudi committed Sep 28, 2021
1 parent 58d26cf commit 316aeb6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 30 deletions.
4 changes: 4 additions & 0 deletions .github/scripts/trigger-workflow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { triggerWorkflow } = require('@twilio/cli-core').releaseScripts.TriggerWorkflow;
(async () => {
await triggerWorkflow();
})();
4 changes: 4 additions & 0 deletions .github/scripts/update-release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { updateRelease } = require('@twilio/cli-core').releaseScripts.UpdateRelease;
(async () => {
await updateRelease();
})();
70 changes: 40 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,52 +63,62 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
update-release:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Checkout cli
uses: actions/checkout@v2
- name: Update release
if: ${{needs.release.outputs.tag-name != ''}}
uses: tubone24/update_release@v1.2.0
env:
GITHUB_TOKEN: ${{ github.token }}
TAG_NAME: ${{needs.release.outputs.tag-name}}
with:
is_append_body: true
body: ${{ github.event.inputs.change-log }}
if: ${{steps.semantic-release.outputs.tag-name != ''}}
run: node .github/scripts/update-release.js
env:
GITHUB_TOKEN: ${{ github.token }}
TAG_NAME: ${{steps.semantic-release.outputs.tag-name}}
RELEASE_BODY: ${{github.event.inputs.change-log}}
REPO_NAME: twilio/twilio-cli-core
oclif-release:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
- run: |
git pull
npm install
- name: Extract branch name
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Invoke Oclif workflow
if: ${{needs.release.outputs.tag-name != ''}}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Oclif Release
repo: twilio/twilio-cli
token: ${{ secrets.REPO_ACCESS_TOKEN }}
inputs: '{ "home-brew-branch": "${{github.event.inputs.homebrew-branch}}", "tag-name": "${{needs.release.outputs.tag-name}}", "pre-release": "${{github.event.inputs.homebrew-prerelease}}"}'
run: node .github/scripts/trigger-workflow.js
env:
WORKFLOW_NAME: 'oclif-release.yml'
REPO_NAME: twilio/twilio-cli
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
BRANCH_NAME: ${{steps.extract_branch.outputs.branch}}
INPUTS: '{ "home-brew-branch": "${{github.event.inputs.homebrew-branch}}", "tag-name": "${{needs.release.outputs.tag-name}}", "pre-release": "${{github.event.inputs.homebrew-prerelease}}"}'
docker-release:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Extract branch name
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Invoke Docker workflow
if: ${{needs.release.outputs.tag-name != ''}}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Docker Hub Release
repo: twilio/twilio-cli
token: ${{ secrets.REPO_ACCESS_TOKEN }}
run: node .github/scripts/trigger-workflow.js
env:
WORKFLOW_NAME: 'docker-release.yml'
REPO_NAME: twilio/twilio-cli
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
BRANCH_NAME: ${{steps.extract_branch.outputs.branch}}
platform-executables-release:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Extract branch name
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Invoke Platform Executables workflow
if: ${{needs.release.outputs.tag-name != ''}}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Platform Executable Release
repo: twilio/twilio-cli
token: ${{ secrets.REPO_ACCESS_TOKEN }}
run: node .github/scripts/trigger-workflow.js
env:
WORKFLOW_NAME: 'platform-executables.yml'
REPO_NAME: twilio/twilio-cli
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
BRANCH_NAME: ${{steps.extract_branch.outputs.branch}}

0 comments on commit 316aeb6

Please sign in to comment.