Skip to content

Commit 8ecf03c

Browse files
authored
Merge pull request #11 from vtex/improve-vtex-install
Bum toolbelt to 3.0.0-beta-ci.2
2 parents 0fe830f + 7bf195a commit 8ecf03c

File tree

3 files changed

+18
-47
lines changed

3 files changed

+18
-47
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
timeout-minutes: 2
3333
steps:
3434
- name: Deploy toolbelt
35-
uses: vtex/action-toolbelt@v3
35+
uses: vtex/action-toolbelt@v4
3636
```
3737
3838
### More advanced, deploy from specific branch and do log in
@@ -62,7 +62,7 @@ jobs:
6262
timeout-minutes: 2
6363
steps:
6464
- name: Deploy toolbelt and login
65-
uses: vtex/action-toolbelt@v3
65+
uses: vtex/action-toolbelt@v4
6666
with:
6767
account: YOUR_ACCOUNT
6868
appKey: ${{ secrets.VTEX_TOOLBELT_KEY }}

action.yml

+15-42
Original file line numberDiff line numberDiff line change
@@ -20,73 +20,46 @@ inputs:
2020
description: 'Workspace to start after login, default master'
2121
required: false
2222
default: master
23-
bin:
24-
description: 'Name to call this version of toolbelt'
23+
version:
24+
description: 'Version of VTEX Toolbelt to be installed'
2525
required: false
26-
default: vtex-e2e
27-
git:
28-
description: 'Source repository to clone (org/repo)'
29-
required: false
30-
default: vtex/toolbelt
31-
branch:
32-
description: 'Which branch to use on git'
33-
required: false
34-
default: toolbelt-action
26+
default: 3.0.0-beta-ci.2
3527

3628
runs:
3729
using: 'composite'
3830
steps:
39-
40-
- name: Checkout VTEX Toolbelt
41-
uses: actions/checkout@v3
42-
with:
43-
repository: ${{ inputs.git }}
44-
ref: ${{ inputs.branch }}
45-
path: /home/runner/work/toolbelt
46-
4731
- name: 'Set up Node.js'
4832
uses: actions/setup-node@v3
4933
with:
5034
node-version: 16
51-
cache: yarn
52-
cache-dependency-path: toolbelt/yarn.lock
53-
continue-on-error: true
54-
35+
- name: Get yarn cache path
36+
id: cache-path
37+
run: echo "::set-output name=dir::$(yarn cache dir)"
38+
shell: bash
5539
- name: Cache VTEX Toolbelt
5640
id: cache-toolbelt
5741
uses: actions/cache@v3
5842
with:
59-
path: |
60-
toolbelt
61-
/usr/local/bin/${{ inputs.bin }}
62-
key: ${{ runner.os }}-${{ inputs.git }}-${{ inputs.branch }}-${{ inputs.bin }}
63-
64-
43+
path: ${{ steps.cache-path.outputs.dir }}
44+
key: ${{ runner.os }}-yarn-${{ inputs.version }}
45+
restore-keys: |
46+
${{ runner.os }}-yarn
6547
- name: Install VTEX Toolbelt
66-
if: steps.cache-toolbelt.outputs.cache-hit != 'true'
48+
# if: steps.cache-toolbelt.outputs.cache-hit != 'true'
6749
run: |
68-
yarn install --frozen-lockfile
69-
yarn build
70-
cp bin/run bin/${{ inputs.bin }}
71-
ln -s $(pwd)/bin/${{ inputs.bin }} /usr/local/bin/
72-
${{ inputs.bin }} whoami || echo "First call to warm it up"
73-
VERSION=$(${{ inputs.bin }} version)
50+
yarn global add vtex@${{ inputs.version }}
51+
VERSION=$(vtex version)
7452
echo ::notice title=VTEX Toolbelt version::$VERSION
75-
working-directory: /home/runner/work/toolbelt
7653
shell: bash
77-
7854
- run: |
7955
bash $GITHUB_ACTION_PATH/entrypoint.sh
80-
shell: bash
8156
env:
82-
VTEX_BIN: ${{ inputs.bin }}
8357
VTEX_ACCOUNT: ${{ inputs.account }}
8458
VTEX_APP_KEY: ${{ inputs.appKey }}
8559
VTEX_APP_TOKEN: ${{ inputs.appToken }}
8660
VTEX_AUTHENTICATE: ${{ inputs.authenticate }}
8761
VTEX_WORKSPACE: ${{ inputs.workspace }}
88-
VTEX_TOOLBELT_GIT: ${{ inputs.git }}
89-
VTEX_TOOLBELT_BRANCH: ${{ inputs.branch }}
62+
shell: bash
9063
9164
branding:
9265
icon: terminal

entrypoint.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ KEY="$VTEX_APP_KEY"
2424
TKN="$VTEX_APP_TOKEN"
2525
WRK=${VTEX_WORKSPACE:-master}
2626
BIN=${VTEX_BIN:-vtex}
27-
GIT=${VTEX_TOOLBELT_GIT:-vtex/toolbelt}
28-
BCH=${VTEX_TOOLBELT_BRANCH:-qe/cypress}
2927
AUT=${VTEX_AUTHENTICATE:-true}
3028
[[ -n $CHECK ]] && AUT='false'
3129

3230
# Show toolbelt version used as GitHub notice
33-
VERSION="$($BIN --version) [from https://github.com/$GIT/tree/$BCH]"
31+
VERSION="$($BIN --version)"
3432
echo ::notice title=Toolbelt version used::$VERSION
3533

3634
# If VTEX_AUTHENTICATE is true

0 commit comments

Comments
 (0)