This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
65 lines (63 loc) · 2.27 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
stages:
- publish_npm
- publish_brew
publish_npm:
stage: publish_npm
image:
name: node:12.18.1
before_script:
- apt-get update && apt-get install -y p7zip-full jq
- npm install -g @oclif/dev-cli
- npm install -g typescript
- npm install -g aws-sdk
- npm version
- oclif-dev -v
- npm ci
- oclif-dev pack
- bash ./alias_create.sh
script:
- oclif-dev publish
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- npm publish
only:
- tags
tags:
- eks-dev-infra
update_brew_formula:
stage: publish_brew
image:
name: linuxbrew/brew:2.4.2
before_script:
- apt-get update && apt-get install -y jq
- "which ssh-agent || ( apt-get update -qy && apt-get install openssh-client -qqy )"
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- echo "$SSH_PUBLIC_KEY" > ~/.ssh/id_rsa.pub
- chmod -R 600 ~/.ssh/*
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- git config --global user.email "[email protected]"
- git config --global user.name "codeStoreGitHub"
script:
- git clone [email protected]:code-store-platform/homebrew-brew.git
- export VERSION=`cat package.json | jq .version | tr -d '"'`
- export URL=https://s3.code.store/codestore-v${VERSION}/codestore-v${VERSION}-darwin-x64.tar.gz
- curl $URL -o codestore-v${VERSION}-darwin-x64.tar.gz
- export SHA256SUM=`sha256sum codestore-v${VERSION}-darwin-x64.tar.gz | awk '{ print $1 }'`
- export FORMULA_VERSION=`cat homebrew-brew/Formula/codestore.rb | grep -P '\d+\.\d+\.\d+(?=\-darwin-x64.tar.gz")' -o`
- echo "FORMULA_VERSION=$FORMULA_VERSION"
- echo "VERSION=$VERSION"
- echo "SHA256SUM=$SHA256SUM"
- >
if [ "$FORMULA_VERSION" != "$VERSION" ]; then
sed -i "s% url \".*\"% url \"$URL\"%" homebrew-brew/Formula/codestore.rb
sed -i "s% sha256 \".*\"% sha256 \"$SHA256SUM\"%" homebrew-brew/Formula/codestore.rb
sed -i "s% version \".*\"% version \"$VERSION\"%" homebrew-brew/Formula/codestore.rb
cd homebrew-brew
git add . | git diff-index --quiet HEAD || git commit -m "codestore v$VERSION" && git push
fi
only:
- tags
tags:
- eks-dev-infra