File tree Expand file tree Collapse file tree 4 files changed +11
-45
lines changed Expand file tree Collapse file tree 4 files changed +11
-45
lines changed Original file line number Diff line number Diff line change 99 - name : Checkout
1010 uses : actions/checkout@v2
1111
12- - name : Test swiftbox and update VERSION
12+ - name : Test swiftbox
1313 run : |
1414 chmod +x swiftbox.sh
1515 VERSION=`./swiftbox.sh version`
1616 echo "::set-env name=version::$VERSION"
1717 if [ $? -eq 0 ]
1818 then
19- if [ $VERSION = `cat VERSION ` ]
19+ if [ v $VERSION ! = `curl -fsSL https://api.github.com/repos/stevapple/swiftbox/releases/latest | jq .tag_name | sed "s/\"//g" ` ]
2020 then
21- exit 0
22- else
23- echo $VERSION > VERSION
2421 echo "::set-env name=updated::true"
25- git config --global user.name "${{ github.actor }}"
26- git config --global user.email "`curl https://api.github.com/users/${{ github.actor }} | jq .email`"
27- git commit -m "Release $VERSION" -a
28- git tag -a "v$VERSION" -m "Release $VERSION"
2922 fi
3023 else
3124 exit 1
3225 fi
33- shell : bash
34-
35- - name : Push to GitHub
36- uses : ad-m/github-push-action@master
37- if : ${{ env.updated }}
38- with :
39- github_token : ${{ secrets.GITHUB_TOKEN }}
4026
41- - name : Release
42- uses : softprops/action-gh -release@v1
27+ - name : Tag and release
28+ uses : avakar/tag-and -release@v1
4329 if : ${{ env.updated }}
4430 with :
45- name : Release ${{ env.version }}
46- files : swiftbox.sh
31+ release_name : Release ${{ env.version }}
4732 tag_name : v${{ env.version }}
4833 env :
4934 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 77
88if [ " E` lsb_release -i --short` " = " EUbuntu" ]
99then
10- $SUDO_FLAG apt-get install wget jq -q=2
10+ $SUDO_FLAG apt-get install curl jq -q=2
1111elif [[ ` cat /etc/redhat-release` =~ " CentOS" || ` cat /etc/redhat-release` =~ " Red Hat Enterprise Linux" ]]
1212then
13- $SUDO_FLAG yum install wget jq -q -y
13+ $SUDO_FLAG yum install curl jq -q -y
1414else
1515 echo " This program only supports Ubuntu and CentOS (RHEL). "
1616 exit 255
1717fi
1818
19- LATEST_VERSION=` curl https://api.github.com/repos/stevapple/swiftbox/releases/latest | jq .tag_name | sed " s/v//" | sed " s/\" //g" `
19+ LATEST_VERSION=` curl -fsSL - https://api.github.com/repos/stevapple/swiftbox/releases/latest | jq .tag_name | sed " s/v//" | sed " s/\" //g" `
2020INSTALL_DIR=" /usr/bin"
2121SWIFTBOX_VERSION=` $INSTALL_DIR /swiftbox version`
2222if [ $? -eq 0 ]
2727fi
2828
2929if [ E$SWIFTBOX_VERSION = E$LATEST_VERSION ]
30- then
31- echo " Already installed the latest version $SWIFTBOX_VERSION at $INSTALL_DIR . "
32- exit
33- elif [[ $SWIFTBOX_VERSION > $LATEST_VERSION ]]
3430then
3531 echo " Already installed the latest version $SWIFTBOX_VERSION at $INSTALL_DIR . "
3632 exit
3733fi
3834
39- $SUDO_FLAG wget -O " $INSTALL_DIR /swiftbox" " https://cdn.jsdelivr.net/gh/stevapple/swiftbox@$LATEST_VERSION /swiftbox.sh"
40- WGET_RESULT=$?
41- if [ $WGET_RESULT -eq 8 ]
42- then
43- echo " Error: It seems this release isn't created yet. "
44- exit $WGET_RESULT
45- elif [ $WGET_RESULT -ge 4 ]
46- then
47- echo " Error: Please check your Internet connection and proxy settings. "
48- exit $WGET_RESULT
49- elif [ $WGET_RESULT -ge 1 ]
50- then
51- echo " Error: Please check your wget config. "
52- exit $WGET_RESULT
53- fi
35+ $SUDO_FLAG curl -o " $INSTALL_DIR /swiftbox" " https://cdn.jsdelivr.net/gh/stevapple/swiftbox@$LATEST_VERSION /swiftbox.sh"
5436$SUDO_FLAG chmod +x " $INSTALL_DIR /swiftbox"
5537hash -r
5638echo $SUCCESS_MESSAGE
Original file line number Diff line number Diff line change 1313 exit 255
1414fi
1515
16- SWIFTBOX_VERSION=" 0.5.5 "
16+ SWIFTBOX_VERSION=" 0.6 "
1717INSTALL_DIR=" /usr/bin"
1818
1919get-latest () {
20- curl https://api.github.com/repos/stevapple/swiftbox/releases/latest | jq .tag_name | sed " s/v//" | sed " s/\" //g"
20+ curl -fsSL https://api.github.com/repos/stevapple/swiftbox/releases/latest | jq .tag_name | sed " s/v//" | sed " s/\" //g"
2121}
2222
2323reinit-env () {
You can’t perform that action at this time.
0 commit comments