-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ede480
commit c5ba3e0
Showing
17 changed files
with
145 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /bin/bash | ||
echo "previous version was $(git describe --tags $(git rev-list --tags --max-count=1))" | ||
echo "WARNING: This operation will creates version tag and push to github" | ||
read -p "Version? (provide the next x.y.z semver) : " TAG | ||
echo $TAG &&\ | ||
[[ "$TAG" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(\.dev)?$ ]] || { echo "Incorrect tag. e.g., 1.2.3 or 1.2.3.dev"; exit 1; } | ||
IFS="." read -r -a VERSION_ARRAY <<< "$TAG" | ||
VERSION_STR="${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}.${VERSION_ARRAY[2]}" | ||
BUILD_NUMBER=$(( ${VERSION_ARRAY[0]} * 10000 + ${VERSION_ARRAY[1]} * 100 + ${VERSION_ARRAY[2]} )) | ||
echo "version: ${VERSION_STR}+${BUILD_NUMBER}" | ||
sed -i -e "s|<key>CFBundleVersion</key>\s*<string>[^<]*</string>|<key>CFBundleVersion</key><string>${VERSION_STR}</string>|" Info.plist &&\ | ||
sed -i -e "s|<key>CFBundleShortVersionString</key>\s*<string>[^<]*</string>|<key>CFBundleShortVersionString</key><string>${VERSION_STR}</string>|" Info.plist &&\ | ||
sed -i "s|ENV VERSION=.*|ENV VERSION=v${TAG}|g" docker/Dockerfile | ||
git add Info.plist docker/Dockerfile | ||
git commit -m "release: version ${TAG}" | ||
echo "creating git tag : v${TAG}" | ||
git push | ||
git tag v${TAG} | ||
git push -u origin HEAD --tags | ||
echo "Github Actions will detect the new tag and release the new version."' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package service_manager | ||
|
||
import ( | ||
"github.com/sagernet/sing-box/adapter" | ||
) | ||
|
||
var ( | ||
services = []adapter.Service{} | ||
preservices = []adapter.Service{} | ||
) | ||
|
||
func RegisterPreservice(service adapter.Service) { | ||
preservices = append(services, service) | ||
} | ||
|
||
func Register(service adapter.Service) { | ||
services = append(services, service) | ||
} | ||
|
||
func StartServices() error { | ||
for _, service := range preservices { | ||
if err := service.Start(); err != nil { | ||
return err | ||
} | ||
} | ||
for _, service := range services { | ||
if err := service.Start(); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
func CloseServices() error { | ||
for _, service := range services { | ||
if err := service.Close(); err != nil { | ||
return err | ||
} | ||
} | ||
for _, service := range preservices { | ||
if err := service.Close(); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} |