Skip to content

Commit

Permalink
feat: use binary-file to execute.
Browse files Browse the repository at this point in the history
  • Loading branch information
huyikun.hyk committed Jan 17, 2024
1 parent ffad183 commit 0204001
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ inputs:
runs:
using: "composite"
steps:
- run: ./script.sh ${{ inputs.account_id }} ${{ inputs.access_key_id }} ${{ inputs.access_key_secret }} ${{ inputs.access }}
- run: ./binary.sh ${{ inputs.account_id }} ${{ inputs.access_key_id }} ${{ inputs.access_key_secret }} ${{ inputs.access }}
shell: bash
9 changes: 9 additions & 0 deletions binary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set -e # 报错后不继续执行
echo 'Serverless-devs installing.'
curl https://images.devsapp.cn/bin/s/v3.0.0 --output /usr/local/bin/s
chmod 777 /usr/local/bin/s
echo '################################################'
s config add --AccountID $1 --AccessKeyID $2 --AccessKeySecret $3 -a $4 -f
echo '################################################'
echo 'Serverless-devs has been installed successfully.'
echo 'The access has been configured automatically, use "s config get" to check.'
4 changes: 3 additions & 1 deletion script.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# unused

set -e # 报错后不继续执行
if ! which node > /dev/null; then
echo "Node is not installed, serverless-dev requires nodejs >= 14.14.0."
Expand All @@ -22,11 +24,11 @@ else
if [ "$result" == 0 ]; then
echo 'Nodejs checked, serverless-devs installing.'
npm i @serverless-devs/s -g --registry=https://registry.npmmirror.com
echo '################################################'
s config add --AccountID $1 --AccessKeyID $2 --AccessKeySecret $3 -a $4 -f
echo '################################################'
echo 'Serverless-devs has been installed successfully.'
echo 'The access has been configured automatically, use "s config get" to check.'
echo '################################################'
else
echo "Serverless-dev requires nodejs >= 14.14.0, please update your local nodejs's version."
fi
Expand Down

0 comments on commit 0204001

Please sign in to comment.