Skip to content

Commit cdb2d9b

Browse files
authored
Merge pull request #62 from cloudgraphdev/alpha
Update Homebrew
2 parents 4764567 + c8b5c34 commit cdb2d9b

File tree

3 files changed

+29
-34
lines changed

3 files changed

+29
-34
lines changed

.github/workflows/homebrew.yaml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@ on:
88
jobs:
99
homebrew:
1010
runs-on: ubuntu-latest
11+
env:
12+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
13+
AWS_SDK_LOAD_CONFIG: true
14+
AWS_PROFILE: cloudgraph-iac
15+
NODE_ENV: "cicd"
1116
steps:
1217
- uses: actions/checkout@v3
1318
with:
1419
fetch-depth: 0
1520
persist-credentials: false
16-
token: ${{secrets.gh_token}}
21+
token: ${{secrets.GH_TOKEN}}
1722
- uses: actions/setup-node@v2
1823
with:
1924
node-version: 16
20-
registry-url: 'https://registry.npmjs.org'
25+
registry-url: "https://registry.npmjs.org"
2126

2227
- name: Mkdir .aws
2328
run: mkdir -p ~/.aws
@@ -30,21 +35,22 @@ jobs:
3035
output=json
3136
3237
[profile cloudgraph-iac]
33-
role_arn = $AWS_ROLE_ARN
38+
role_arn = ${{ secrets.AWS_ROLE_ARN }}
3439
source_profile = default
3540
EOF
3641
- name: Set .aws/credentials
3742
run: |
3843
cat << EOF > ~/.aws/credentials
3944
[default]
40-
aws_access_key_id = $AWS_ACCESS_KEY_ID
41-
aws_secret_access_key = $AWS_SECRET_ACCESS_KEY
45+
aws_access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }}
46+
aws_secret_access_key = ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4247
EOF
48+
4349
- name: Get cache directory
4450
id: npm-cache-dir
4551
run: |
4652
echo "::set-output name=dir::$(npm config get cache)"
47-
53+
4854
- name: Restoring cache
4955
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
5056
uses: actions/cache@v2
@@ -61,14 +67,21 @@ jobs:
6167
- name: Build
6268
run: yarn build
6369

64-
- name: Homebrew
65-
run: yarn homebrew
70+
- name: Add SSH key
71+
env:
72+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
73+
run: |
74+
mkdir -p ~/.ssh
75+
ssh-keyscan github.com >> ~/.ssh/known_hosts
76+
echo "${{ secrets.AUTODEPLOY_SSH_KEY }}" > ~/.ssh/github_actions
77+
chmod 600 ~/.ssh/github_actions
78+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
79+
ssh-add ~/.ssh/github_actions
80+
81+
- name: Homebrew
6682
env:
67-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
68-
AWS_SDK_LOAD_CONFIG: true
69-
AWS_PROFILE: cloudgraph-iac
70-
AWS_ACCESS_KEY_ID: ${{secrets.aws_access_key_id}}
71-
AWS_SECRET_ACCESS_KEY: ${{secrets.aws_secret_access_key}}
72-
AWS_ROLE_ARN: ${{secrets.aws_role_arn}}
73-
NODE_ENV: 'cicd'
74-
83+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
84+
run: |
85+
git config --global user.email "no-reply@autocloud.dev"
86+
git config --global user.name "autocloud-deploy-bot"
87+
yarn homebrew

release/scripts/_github_setup

Lines changed: 0 additions & 11 deletions
This file was deleted.

release/scripts/homebrew.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,19 +186,12 @@ async function updateCgNodeFormula(brewDir) {
186186
console.log(`done updating cg-node Formula in ${formulaPath}`)
187187
}
188188

189-
async function setupGit() {
190-
const githubSetupPath = path.join(__dirname, '_github_setup')
191-
await execa(githubSetupPath)
192-
}
193-
194189
async function updateHomebrew() {
195190
const tmp = path.join(__dirname, 'tmp')
196191
const homebrewDir = path.join(tmp, 'homebrew-tap')
197192
mkdirp.sync(tmp)
198193
rm.sync(homebrewDir)
199194

200-
// await setupGit()
201-
202195
console.log(
203196
`cloning https://github.com/cloudgraphdev/homebrew-tap to ${homebrewDir}`
204197
)

0 commit comments

Comments
 (0)