Skip to content

Commit f58ed4e

Browse files
authored
Merge pull request #37 from cloudgraphdev/beta
2 parents 999d853 + a7253e7 commit f58ed4e

35 files changed

+11284
-11372
lines changed

.github/pull_request_template.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Issue tracker links
2+
3+
_Add links to any relevant tasks/stories/bugs/pagerduty/etc_
4+
5+
*Example - dummy TODO project*
6+
7+
[TODO-123](https://autoclouddev.atlassian.net/browse/TODO-123)
8+
9+
## Changes/solution
10+
11+
_How does this change address the problem?_
12+
13+
## Testing
14+
15+
_Describe how the testing was done, plus evidence, if not covered by automated tests_
16+
17+
## Notes and considerations
18+
19+
_Add any additional notes and/or considerations_
20+
21+
## Dependencies
22+
23+
_Add dependencies on any other PRs, if applicable

.github/workflows/homebrew.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: homebrew
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
homebrew:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: 16
16+
registry-url: 'https://registry.npmjs.org'
17+
18+
- name: Mkdir .aws
19+
run: mkdir -p /home/node/.aws
20+
21+
- name: Set .aws/config
22+
run: |
23+
cat << EOF > /home/node/.aws/config
24+
[default]
25+
region=us-east-1
26+
output=json
27+
28+
[profile cloudgraph-iac]
29+
role_arn = $AWS_ROLE_ARN
30+
source_profile = default
31+
EOF
32+
- name: Set .aws/credentials
33+
run: |
34+
cat << EOF > /home/node/.aws/credentials
35+
[default]
36+
aws_access_key_id = $AWS_ACCESS_KEY_ID
37+
aws_secret_access_key = $AWS_SECRET_ACCESS_KEY
38+
EOF
39+
- name: Get cache directory
40+
id: npm-cache-dir
41+
run: |
42+
echo "::set-output name=dir::$(npm config get cache)"
43+
44+
- name: Restoring cache
45+
id: npm-cache
46+
uses: actions/cache@v2
47+
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
48+
with:
49+
path: ${{ steps.npm-cache-dir.outputs.dir }}
50+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
51+
restore-keys: |
52+
${{ runner.os }}-yarn-
53+
54+
- name: Install Packages
55+
if: steps.npm-cache.outputs.cache-hit != 'true'
56+
run: yarn install --frozen-lockfile --cache-folder .npm --prefer-offline
57+
58+
- name: Build
59+
run: yarn build
60+
61+
- name: Homebrew
62+
run: yarn homebrew
63+
env:
64+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
65+
AWS_SHARED_CREDENTIALS_FILE: /home/node/.aws/credentials
66+
AWS_CONFIG_FILE: /home/node/.aws/config
67+
AWS_SDK_LOAD_CONFIG: true
68+
AWS_PROFILE: cloudgraph-iac
69+
AWS_ACCESS_KEY_ID: ${{secrets.aws_access_key_id}}
70+
AWS_SECRET_ACCESS_KEY: ${{secrets.aws_secret_access_key}}
71+
AWS_ROLE_ARN: ${{secrets.aws_role_arn}}
72+
NODE_ENV: 'cicd'
73+

.github/workflows/notify.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: notify
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 16
15+
- run: |
16+
GIT_COMMIT_TILE=$(git log -1 --pretty=format:"%s")
17+
curl -X POST --data-urlencode "payload={\"attachments\":[{\"fallback\":\"$GIT_AUTHOR_NAME released new $REPO_NAME version of $GITHUB_REF_NAME\",\"color\":\"good\",\"title\":\"Version $GITHUB_REF_NAME of $REPO_NAME released\",\"title_link\":\"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/$GITHUB_REF_NAME\",\"fields\":[{\"title\":\"Tag\",\"value\":\"<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commits/$GITHUB_REF_NAME|$GITHUB_REF_NAME>\",\"short\":true},{\"title\":\"Commit\",\"value\":\"<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$GITHUB_REF_NAME|$GIT_COMMIT_TILE>\",\"short\":true}],\"footer\":\"$REPO_NAME\",\"ts\":\"$( date +%s )\"}]}" $SLACK_WEBHOOK
18+
env:
19+
REPO_NAME: ${{ github.event.repository.name }}
20+
GIT_AUTHOR_NAME: 'AutoCloud Deploy Bot'
21+
SLACK_WEBHOOK: ${{secrets.slack_api_endpoint}}

.github/workflows/pr-validator.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: pr-validator
2+
3+
on:
4+
pull_request:
5+
types: [synchronize, opened, reopened, edited]
6+
branches:
7+
- master
8+
- beta
9+
10+
jobs:
11+
pr-validation:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run : |
16+
if [ "$TARGET_BRANCH" == "master" ] && [ "$SOURCE_BRANCH" == "beta" ]; then
17+
echo "Merge from $SOURCE_BRANCH to $TARGET_BRANCH is valid"
18+
exit 0
19+
elif [ "$TARGET_BRANCH" == "beta" ] && [ "$SOURCE_BRANCH" == "alpha" ]; then
20+
echo "Merge from $SOURCE_BRANCH to $TARGET_BRANCH is valid"
21+
exit 0
22+
else
23+
echo "You cannot merge from $SOURCE_BRANCH to $TARGET_BRANCH"
24+
exit 1
25+
fi
26+
env:
27+
SOURCE_BRANCH: ${{ github.head_ref }}
28+
TARGET_BRANCH: ${{ github.base_ref }}
29+
30+

.github/workflows/publish.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: publish
5+
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
- alpha
12+
- beta
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-node@v2
20+
with:
21+
node-version: 16
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Get cache directory
25+
id: npm-cache-dir
26+
run: |
27+
echo "::set-output name=dir::$(npm config get cache)"
28+
29+
- name: Restoring cache
30+
uses: actions/cache@v2
31+
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
32+
with:
33+
path: ${{ steps.npm-cache-dir.outputs.dir }}
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-yarn-
37+
38+
- name: Install Packages
39+
run: yarn install --frozen-lockfile --cache-folder .npm --prefer-offline
40+
41+
- name: Build
42+
run: yarn prepack
43+
44+
- name: Test
45+
run: yarn lint
46+
47+
- name: Publish
48+
run: npx semantic-release -r $GITHUB_SERVER_URL/$GITHUB_REPOSITORY
49+
env:
50+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
51+
GITHUB_TOKEN: ${{secrets.gh_token}}
52+
GIT_AUTHOR_NAME: 'autocloud-deploy-bot'
53+
GIT_AUTHOR_EMAIL: 'no-reply@autocloud.dev'
54+
GIT_COMMITTER_NAME: 'autocloud-deploy-bot'
55+
GIT_COMMITTER_EMAIL: 'no-reply@autocloud.dev'
56+
NODE_ENV: 'cicd'

.releaserc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ plugins:
1515
- changelogFile: CHANGELOG.md
1616
- - "@semantic-release/git"
1717
- assets:
18-
- CHANGELOG.md
19-
- package.json
18+
- CHANGELOG.md
19+
- package.json
2020
- - "@semantic-release/npm"
2121
- npmPublish: true
22-
- "@semantic-release/gitlab"
22+
- "@semantic-release/github"
2323
verifyConditions:
2424
- "@semantic-release/changelog"
25-
- "@semantic-release/gitlab"
25+
- "@semantic-release/github"
2626
- "@semantic-release/npm"
2727
prepare:
2828
- "@semantic-release/changelog"
2929
- "@semantic-release/npm"
3030
- - "@semantic-release/git"
3131
- message: "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}"
3232
publish:
33-
- "@semantic-release/gitlab"
33+
- "@semantic-release/github"
3434
- "@semantic-release/npm"
3535
success: false
3636
fail: false

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# [0.21.0-beta.1](https://github.com/cloudgraphdev/cli/compare/0.20.12...0.21.0-beta.1) (2022-03-16)
2+
3+
4+
### Bug Fixes
5+
6+
* **brew:** update brew script with version key, update brew install dirs ([8d79abb](https://github.com/cloudgraphdev/cli/commit/8d79abb9f8cee442ff5e912dd457101b9d2fc817))
7+
8+
9+
### Features
10+
11+
* Update CG to use Oclif core and space for the `topicSeparator` ([8b1e7e8](https://github.com/cloudgraphdev/cli/commit/8b1e7e853a5cbd92b47abe7773283b44a7a03b35))
12+
13+
# [0.21.0-alpha.5](https://github.com/cloudgraphdev/cli/compare/0.21.0-alpha.4...0.21.0-alpha.5) (2022-03-16)
14+
15+
16+
### Features
17+
18+
* Update CG to use Oclif core and space for the `topicSeparator` ([8b1e7e8](https://github.com/cloudgraphdev/cli/commit/8b1e7e853a5cbd92b47abe7773283b44a7a03b35))
19+
20+
# [0.21.0-alpha.4](https://github.com/cloudgraphdev/cli/compare/0.21.0-alpha.3...0.21.0-alpha.4) (2022-03-15)
21+
22+
23+
### Bug Fixes
24+
25+
* **brew:** update brew script with version key, update brew install dirs ([8d79abb](https://github.com/cloudgraphdev/cli/commit/8d79abb9f8cee442ff5e912dd457101b9d2fc817))
26+
127
## [0.20.12](https://gitlab.com/auto-cloud/cloudgraph/cli/compare/0.20.11...0.20.12) (2022-03-01)
228

329

0 commit comments

Comments
 (0)