Skip to content

Commit

Permalink
Merge pull request #1290 from jovotech/v4/dev
Browse files Browse the repository at this point in the history
馃懛 Update CI/CD
  • Loading branch information
aswetlow committed Apr 21, 2022
2 parents 50b2cf1 + 7ad96e2 commit 130f858
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [12.x, 14.x, 16.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:

Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: workflow

on:
push:
# start workflow on releases named YYYY-MM-DD-(patch|minor)
# e.g. 2022-04-21-patch, 2022-04-21-2-patch, 2022-04-21-minor
tags:
- "20*"

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x]
os: [ubuntu-latest]
steps:

- uses: actions/checkout@v2
with:
fetch-depth: '0'

- name: Prepare repository
run: git checkout v4/latest

# take RELEASE_VERSION from release and add to $GITHUB_ENV
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

# set RELEASE variable to 'patch' RELEASE_VERSION ends with 'patch'
- if: endsWith(env.RELEASE_VERSION, 'patch')
run: echo "RELEASE=patch" >> $GITHUB_ENV

# set RELEASE variable to 'minor' RELEASE_VERSION ends with 'minor'
- if: endsWith(env.RELEASE_VERSION, 'minor')
run: echo "RELEASE=minor" >> $GITHUB_ENV

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/

- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- run: |
git checkout v4/latest
git push --set-upstream origin v4/latest
- run: npm install --ci
- run: npm run setup:dev
- run: npm run prettier
- run: npm run eslint
- run: npm run test

- name: npm version
uses: mathiasvr/command-output@v1
id: npmversion
with:
run: |
npm run updateVersions:${{env.RELEASE}}
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_PACKAGES}}

- run: |
git add .
git commit -m "Release ${{env.RELEASE_VERSION}}"
git push --set-upstream origin v4/latest
- run: npm run publishPackages
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_PACKAGES}}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":rocket: New ${{env.RELEASE_VERSION}} release"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: ${{ steps.npmversion.outputs.stdout }}
MSG_MINIMAL: "actions url"
1 change: 1 addition & 0 deletions integrations/db-dynamodb/src/DynamoDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export class DynamoDb extends DbPlugin<DynamoDbConfig> {
);
}
}
throw e;
}
}

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"test": "lerna exec npm run test --ignore @jovotech/examples-*",
"version": "node scripts/update-peer-dependencies.js",
"preparePublish": "npm run bootstrap && npm run prettier && npm run eslint && npm run build && npm run test",
"updateVersions": "lerna version --no-push",
"publishPackages": "lerna publish from-package",
"doPublish": "npm run updateVersions && npm run publishPackages"
"updateVersions:minor": "lerna version minor --yes --no-push --no-git-tag-version",
"updateVersions:patch": "lerna version patch --yes --no-push --no-git-tag-version",
"publishPackages": "lerna publish from-git --yes --no-verify-access"
},
"author": "jovotech",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export class BuildHook extends PluginHook<BuildPlatformEvents> {
},
);

buildTask.add(buildInteractionModelTask, projectFilesTask);
buildTask.add(projectFilesTask, buildInteractionModelTask);

await buildTask.run();
}
Expand Down

0 comments on commit 130f858

Please sign in to comment.