Skip to content

Commit

Permalink
feat: Added the workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshmiravalir authored Aug 24, 2021
1 parent c631fa8 commit 3b0996a
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Cli-core Build

on:
repository_dispatch:
types: [ releaseCliCore ]
push:
branches: [ test_branch_actions ]
workflow_dispatch:
env:
CHANGE_LOG: ''

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v2
- run: npm install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
updateAPIDefinitions:
runs-on: ubuntu-latest
steps:
- run: mkdir -p ~/oai_definitions/json
- run: cd ~/oai_definitions
- run: pwd
- run: ls
- uses: actions/checkout@v2
with:
repository: 'LakshmiRavali/twilio-oai'
token: ${{ secrets.OAI_TOKEN }}
- run: |
cp -R spec/json/. ~/oai_definitions/json/
cp -R CHANGES.md ~/oai_definitions/CHANGES.md
- uses: actions/checkout@v2
- name: Update OAI folder
id: updateFolder
run: |
cp -R ~/oai_definitions/CHANGES.md OAI_CHANGES.md
bash scripts/updateApiDefinitions.sh
release:
runs-on: ubuntu-latest
needs: [updateAPIDefinitions]
steps:
- uses: actions/checkout@v2
- run: git pull origin test_branch_actions
- run: git branch
- run: git log -3
- run: npm install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: semanticRelease
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
- run: npm ci && npx semantic-release -t \${version}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
updateRelease:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
needs: [release]
steps:
- uses: actions/checkout@v2
- run: git fetch --tags
- name: Getting tag
id: test
run: |
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))"
echo "::set-output name=CHANGE_LOG::$(node scripts/update-api-definitions.js)"
- run: echo "${{steps.test.outputs.TAG_NAME}}"
- run: echo "${{steps.test.outputs.CHANGE_LOG}}"
- name: update release
id: update_release
uses: tubone24/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
TAG_NAME: ${{steps.test.outputs.TAG_NAME}}
with:
is_append_body: true
body: ${{env.CHANGE_LOG}} # new body text

0 comments on commit 3b0996a

Please sign in to comment.