Skip to content

Commit

Permalink
Source using Loyalsoldier/geoip
Browse files Browse the repository at this point in the history
  • Loading branch information
sunls2 committed Oct 28, 2024
1 parent ecd02c1 commit 72d7a29
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/release-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd release
git init
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git remote add origin https://github-action:$GITHUB_TOKEN@github.com/SagerNet/sing-geoip.git
git remote add origin https://github-action:$GITHUB_TOKEN@github.com/sunls2/sing-geoip.git
git branch -M release
cp ../*.db ../*.sha256sum .
git add .
Expand Down
2 changes: 1 addition & 1 deletion .github/release-rule-set.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd rule-set
git init
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git remote add origin https://github-action:$GITHUB_TOKEN@github.com/SagerNet/sing-geoip.git
git remote add origin https://github-action:$GITHUB_TOKEN@github.com/sunls2/sing-geoip.git
git branch -M rule-set
git add .
git commit -m "Update rule-set"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tag:
description: "The tag version you want to build"
schedule:
- cron: "0 8 12 * *"
- cron: "0 2 * * 4"
jobs:
build:
name: Build
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func download(release *github.RepositoryRelease) ([]byte, error) {
return *it.Name == "Country.mmdb"
})
if geoipAsset == nil {
return nil, E.New("Country.mmdb not found in upstream release ", release.Name)
return nil, E.New("Country.mmdb not found in upstream release ", release.GetTagName())
}
return get(geoipAsset.BrowserDownloadURL)
}
Expand Down Expand Up @@ -170,7 +170,7 @@ func release(source string, destination string, output string, ruleSetOutput str
if err != nil {
log.Warn("missing destination latest release")
} else {
if os.Getenv("NO_SKIP") != "true" && strings.Contains(*destinationRelease.Name, *sourceRelease.Name) {
if os.Getenv("NO_SKIP") != "true" && strings.Contains(destinationRelease.GetTagName(), sourceRelease.GetTagName()) {
log.Info("already latest")
setActionOutput("skip", "true")
return nil
Expand Down Expand Up @@ -239,7 +239,7 @@ func release(source string, destination string, output string, ruleSetOutput str
outputRuleSet.Close()
}

setActionOutput("tag", *sourceRelease.Name)
setActionOutput("tag", sourceRelease.GetTagName())
return nil
}

Expand All @@ -248,7 +248,7 @@ func setActionOutput(name string, content string) {
}

func main() {
err := release("Dreamacro/maxmind-geoip", "sagernet/sing-geoip", "geoip.db", "rule-set")
err := release("Loyalsoldier/geoip", "sunls2/sing-geoip", "geoip.db", "rule-set")
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 72d7a29

Please sign in to comment.