mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-07-01 12:03:25 +00:00
Compare commits
3 Commits
v1.0.0-alp
...
v1.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
2e4248e40e | |||
4aeba55550 | |||
2b3842e61c |
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: build
|
name: release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -9,14 +9,12 @@ jobs:
|
|||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Checkout
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
-
|
- name: Set up Go
|
||||||
name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '1.16.2'
|
go-version: '1.16.2'
|
||||||
@ -28,3 +26,14 @@ jobs:
|
|||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Checkout Dist
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: 'wdvxdr1123/dist'
|
||||||
|
ref: master
|
||||||
|
ssh-key: ${{ secrets.SSH_KEY }}
|
||||||
|
path: upstream/dist
|
||||||
|
|
||||||
|
- name: Update Dist
|
||||||
|
run: ./scripts/upload_dist.sh
|
||||||
|
@ -16,6 +16,8 @@ builds:
|
|||||||
- amd64
|
- amd64
|
||||||
- arm
|
- arm
|
||||||
- arm64
|
- arm64
|
||||||
|
goarm:
|
||||||
|
- 7
|
||||||
ignore:
|
ignore:
|
||||||
- goos: darwin
|
- goos: darwin
|
||||||
goarch: arm
|
goarch: arm
|
||||||
@ -48,3 +50,11 @@ archives:
|
|||||||
format_overrides:
|
format_overrides:
|
||||||
- goos: windows
|
- goos: windows
|
||||||
format: zip
|
format: zip
|
||||||
|
|
||||||
|
nfpms:
|
||||||
|
- license: AGPL 3.0
|
||||||
|
homepage: https://go-cqhttp.org
|
||||||
|
file_name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
|
||||||
|
formats:
|
||||||
|
- deb
|
||||||
|
- rpm
|
@ -28,6 +28,9 @@ import (
|
|||||||
var Version = "unknown"
|
var Version = "unknown"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
if Version != "unknown" {
|
||||||
|
return
|
||||||
|
}
|
||||||
info, ok := debug.ReadBuildInfo()
|
info, ok := debug.ReadBuildInfo()
|
||||||
if ok {
|
if ok {
|
||||||
Version = info.Main.Version
|
Version = info.Main.Version
|
||||||
|
2
main.go
2
main.go
@ -444,7 +444,7 @@ func OldPasswordDecrypt(encryptedPassword string, key []byte) string {
|
|||||||
|
|
||||||
func checkUpdate() {
|
func checkUpdate() {
|
||||||
log.Infof("正在检查更新.")
|
log.Infof("正在检查更新.")
|
||||||
if coolq.Version == "unknown" {
|
if coolq.Version == "(devel)" {
|
||||||
log.Warnf("检查更新失败: 使用的 Actions 测试版或自编译版本.")
|
log.Warnf("检查更新失败: 使用的 Actions 测试版或自编译版本.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
19
scripts/upload_dist.sh
Normal file
19
scripts/upload_dist.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$GITHUB_ACTIONS" != "true" ]; then
|
||||||
|
echo "This script is only meant to be run in GitHub Actions."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -f dist/*.tar.gz upstream/dist/
|
||||||
|
cp -f dist/*.zip upstream/dist/
|
||||||
|
cd upstream/dist
|
||||||
|
LATEST_VERSION="${GITHUB_REF#"refs/tags/"}"
|
||||||
|
git config --local user.name 'Github Actions'
|
||||||
|
git config --local user.email 'github-actions@users.noreply.github.com'
|
||||||
|
git add --all
|
||||||
|
git commit -m "update to $LATEST_VERSION"
|
||||||
|
git tag -d "${GITHUB_REF#"refs/tags/"}"
|
||||||
|
git tag "${GITHUB_REF#"refs/tags/"}"
|
||||||
|
git push
|
||||||
|
git push --tags
|
Reference in New Issue
Block a user