Skip to content

Commit

Permalink
Refine focal script.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jul 12, 2023
1 parent a7a856f commit f17f696
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 57 deletions.
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,20 +399,13 @@ Release version for BT and aaPanel:

> Note: The [BT forum](https://www.bt.cn/bbs/thread-90890-1-1.html) and [FAQ](https://github.com/ossrs/srs-cloud/issues/4) might need to be updated.
To refresh current tag for mgmt:
To refresh current tag for mgmt and platform:

* Run `./scripts/refresh-current-tag.sh`
* Run `./auto/mgmt_platform_pub.sh -refresh`

> Note: It does not update the tag for release.
## Deprecated

Release [stable version](https://api.ossrs.net/terraform/v1/releases):

* MUST update the stable version manually in `releases/version.go`
* Then run `./auto/releases_pub.sh`

> Note: We disable the upgrade feature, so should never update the stable version.
The upgrade feature has been disabled, which means we no longer update the
[version API](https://api.ossrs.net/terraform/v1/releases), nor do we update
the `releases/version.go` file, and we don't use `./auto/releases_pub.sh`.

2022.11

34 changes: 25 additions & 9 deletions auto/focal_pub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ WORK_DIR=$(cd $(dirname $REALPATH)/.. && pwd)
echo "Run pub at $WORK_DIR from $0"
cd $WORK_DIR

git st |grep -q 'nothing to commit'
if [[ $? -ne 0 ]]; then
echo "Failed: Please commit before release";
exit 1
help=false

while [[ "$#" -gt 0 ]]; do
case $1 in
-h|--help) help=true; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
done

if [ "$help" = true ]; then
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -h, --help Show this help message and exit"
exit 0
fi

RELEASE=$(git describe --tags --abbrev=0 --match focal-*)
Expand All @@ -20,12 +30,18 @@ VERSION="1.0.$NEXT"
TAG="focal-v$VERSION"
echo "publish version $VERSION as tag $TAG"

git tag -d $TAG 2>/dev/null && (git push origin :$TAG; git push gitee :$TAG)
git tag $TAG
git push origin $TAG -f
git st |grep -q 'nothing to commit'
if [[ $? -ne 0 ]]; then
echo "Failed: Please commit before release";
exit 1
fi

######################################################################
git tag -d $TAG 2>/dev/null; git push origin :$TAG 2>/dev/null; git push gitee :$TAG 2>/dev/null
echo "Delete tag OK: $TAG"

git remote |grep -q gitee && git push gitee && git push gitee $TAG -f
git remote |grep -q cloud && git push cloud && git push cloud $TAG -f
git tag $TAG && git push origin $TAG && git push gitee
echo "Publish OK: $TAG"

echo "publish $TAG ok"
echo " Please test it after https://github.com/ossrs/srs-cloud/actions/workflows/focal.yml done"
Expand Down
4 changes: 0 additions & 4 deletions auto/mgmt_platform_pub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ if [[ $(grep -q "const version = \"$TAG\"" platform/version.go || echo no) == no
echo "Failed: Please update platform/version.go to $TAG"
exit 1
fi
if [[ $(grep -q "const latest = \"$TAG\"" releases/version.go || echo no) == no ]]; then
echo "Failed: Please update releases/version.go to $TAG"
exit 1
fi

git st |grep -q 'nothing to commit'
if [[ $? -ne 0 ]]; then
Expand Down
32 changes: 0 additions & 32 deletions scripts/refresh-current-tag.sh

This file was deleted.

0 comments on commit f17f696

Please sign in to comment.