Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
UnblockNeteaseMusic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror From Github
UnblockNeteaseMusic
Commits
7ff43126
Commit
7ff43126
authored
4 years ago
by
Silvan
Browse files
Options
Downloads
Patches
Plain Diff
[change] version display
parent
aa1eb018
No related branches found
Branches containing commit
Tags
0.2.6
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.github/workflows/auto_release.yml
+107
-0
107 additions, 0 deletions
.github/workflows/auto_release.yml
app.go
+2
-1
2 additions, 1 deletion
app.go
build.sh
+1
-1
1 addition, 1 deletion
build.sh
config/config.go
+3
-2
3 additions, 2 deletions
config/config.go
with
113 additions
and
4 deletions
.github/workflows/auto_release.yml
0 → 100644
+
107
−
0
View file @
7ff43126
name
:
release Unblockneteasemusic
on
:
push
:
tags
:
-
"
0*"
jobs
:
build_luci
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
checkout
uses
:
actions/checkout@v2
with
:
ref
:
master
fetch-depth
:
0
lfs
:
true
-
name
:
set git identity
run
:
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
-
name
:
init environment
run
:
|
sudo -E apt-get -y install upx
-
name
:
Set up Go 1.x
uses
:
actions/setup-go@v2
with
:
go-version
:
^1.15.1
id
:
go
-
name
:
get dependencies
run
:
|
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
-
name
:
build
run
:
|
CurrentVersion=${{ github.ref }}
CurrentVersion=${CurrentVersion/'refs/tags/'/''}
Project=github.com/cnsilvan/UnblockNeteaseMusic
Path="$Project/version"
ExecName="UnblockNeteaseMusic"
GitCommit=$(git rev-parse --short HEAD || echo unsupported)
GoVersion=$(go version)
BuildTime=$(TZ=UTC-8 date "+%Y-%m-%d %H:%M:%S")
platforms=("windows/amd64" "darwin/amd64" "linux/arm" "linux/amd64" "linux/arm5" "linux/mipsle" "linux/mips" "linux/mipsle-softfloat" "linux/mips-softfloat" "linux/386")
#platforms=("windows/amd64" "darwin/amd64")
buildGo() {
GOOS=$1
GOARCH=$2
GOARM=""
GOMIPS=""
output_name=$ExecName
suffix=""
TargetDir=bin/$GOOS/$GOARCH
if [ $GOOS = "windows" ]; then
output_name+='.exe'
fi
if [ $GOARCH = "arm5" ]; then
GOARCH="arm"
GOARM="GOARM=5"
suffix="5"
fi
if [ $GOARCH = "mipsle-softfloat" ]; then
GOARCH="mipsle"
GOMIPS="GOMIPS=softfloat"
suffix="-softfloat"
elif [ $GOARCH = "mips-softfloat" ]; then
GOARCH="mips"
GOMIPS="GOMIPS=softfloat"
suffix="-softfloat"
fi
echo "Building($GOOS/$GOARCH$suffix)..."
echo $GOMIPS $GOARM
env $GOARM $GOMIPS GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 env GOPROXY=https://goproxy.io go build -ldflags "-X '$Path.Version=$CurrentVersion' -X '$Path.BuildTime=$BuildTime' -X '$Path.GoVersion=$GoVersion' -X '$Path.GitCommit=$GitCommit' -X '$Path.ExGoVersionInfo=$suffix' -w -s" -o $TargetDir/$output_name
if [ $? -ne 0 ]; then
echo 'An error has occurred! Aborting the script execution...'
exit 1
fi
echo "Upxing..."
upx --lzma --best $TargetDir/$output_name
cp ./createCertificate.sh $TargetDir/createCertificate.sh
ZipName=$ExecName"-"$GOOS"-"$GOARCH"$suffix"
zip -j $TargetDir/$ZipName.zip $TargetDir/createCertificate.sh $TargetDir/$output_name
cp $TargetDir/$ZipName.zip bin/releaseUpload/
}
rm -rf bin/
mkdir -p bin/releaseUpload
for platform in "${platforms[@]}"; do
platform_split=(${platform//\// })
buildGo ${platform_split[0]} ${platform_split[1]}
done
echo "--------------------------------------------"
echo "Version:" $CurrentVersion
echo "Git commit:" $GitCommit
echo "Go version:" $GoVersion
echo "Build Time:" $BuildTime
echo "Build Finish"
echo "--------------------------------------------"
-
name
:
create release and upload asset
uses
:
svenstaro/upload-release-action@v2
with
:
repo_token
:
${{ secrets.GITHUB_TOKEN }}
file
:
bin/releaseUpload/*
file_glob
:
true
tag
:
${{ github.ref }}
overwrite
:
true
body
:
"
[bot]
automatically
publish
packages
compiled
with
the
latest
source
code"
This diff is collapsed.
Click to expand it.
app.go
+
2
−
1
View file @
7ff43126
package
main
import
(
"fmt"
"log"
"os"
"os/signal"
...
...
@@ -64,7 +65,7 @@ func main() {
log
.
Println
(
"exiting UnblockNeteaseMusic"
)
}
}
else
{
log
.
Println
(
version
.
AppVersion
())
fmt
.
Println
(
version
.
AppVersion
())
}
}
func
restoreHosts
()
{
...
...
This diff is collapsed.
Click to expand it.
build.sh
+
1
−
1
View file @
7ff43126
CurrentVersion
=
0.2.
5
CurrentVersion
=
0.2.
6
Project
=
github.com/cnsilvan/UnblockNeteaseMusic
Path
=
"
$Project
/version"
ExecName
=
"UnblockNeteaseMusic"
...
...
This diff is collapsed.
Click to expand it.
config/config.go
+
3
−
2
View file @
7ff43126
...
...
@@ -2,6 +2,7 @@ package config
import
(
"flag"
"fmt"
"github.com/cnsilvan/UnblockNeteaseMusic/common"
"github.com/cnsilvan/UnblockNeteaseMusic/utils"
"github.com/cnsilvan/UnblockNeteaseMusic/version"
...
...
@@ -36,7 +37,8 @@ func ValidParams() bool {
}
}
if
*
V
{
log
.
Println
(
version
.
FullVersion
())
// active call should use fmt
fmt
.
Println
(
version
.
FullVersion
())
return
false
}
sources
:=
strings
.
Split
(
strings
.
ToLower
(
*
Source
),
":"
)
...
...
@@ -99,7 +101,6 @@ func ValidParams() bool {
}
log
.
SetOutput
(
logFile
)
}
else
{
log
.
SetOutput
(
os
.
Stdout
)
}
return
true
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment