Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 #5

Merged
merged 5 commits into from
Mar 27, 2021
Merged

3 #5

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@ jobs:

- name: Build
run: |
bash scripts/ci_release.sh windows amd64
bash scripts/ci_release.sh windows 386
#bash scripts/ci_release.sh windows amd64
#bash scripts/ci_release.sh windows 386
bash scripts/ci_release.sh linux amd64
bash scripts/ci_release.sh linux 386
bash scripts/ci_release.sh linux arm64
bash scripts/ci_release.sh linux arm
bash scripts/ci_release.sh linux mipsle
bash scripts/ci_release.sh linux mips
bash scripts/ci_release.sh darwin amd64
# bash scripts/ci_release.sh linux arm
# bash scripts/ci_release.sh linux mipsle
# bash scripts/ci_release.sh linux mips
# bash scripts/ci_release.sh darwin amd64

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
scripts/build/cloud-torrent_windows_amd64.exe.gz
scripts/build/cloud-torrent_windows_386.exe.gz
#scripts/build/cloud-torrent_windows_amd64.exe.gz
#scripts/build/cloud-torrent_windows_386.exe.gz
scripts/build/cloud-torrent_linux_amd64.gz
scripts/build/cloud-torrent_linux_386.gz
scripts/build/cloud-torrent_linux_arm64.gz
scripts/build/cloud-torrent_linux_arm_armv5.gz
scripts/build/cloud-torrent_linux_arm_armv6.gz
scripts/build/cloud-torrent_linux_arm_armv7.gz
scripts/build/cloud-torrent_linux_mipsle.gz
scripts/build/cloud-torrent_linux_mips.gz
scripts/build/cloud-torrent_darwin_amd64.gz
# scripts/build/cloud-torrent_linux_arm_armv5.gz
# scripts/build/cloud-torrent_linux_arm_armv6.gz
# scripts/build/cloud-torrent_linux_arm_armv7.gz
# scripts/build/cloud-torrent_linux_mipsle.gz
# scripts/build/cloud-torrent_linux_mips.gz
# scripts/build/cloud-torrent_darwin_amd64.gz
prerelease: false
draft: false
body_path: gittaglogs.txt
Expand Down
9 changes: 9 additions & 0 deletions engine/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ func (torrent *Torrent) Update(t *torrent.Torrent) {
meta := t.Metainfo()
m := meta.Magnet(t.Name(), t.InfoHash())
torrent.Magnet = m.String()
/*
// convert torrent to magnet
// since anacrolix/torrent version 1.26+
meta := t.Metainfo()
if ifo, err := meta.UnmarshalInfo(); err == nil {
magnet := meta.Magnet(nil, &ifo).String()
torrent.Magnet = magnet
}
*/
}
torrent.t = t
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2
github.com/elazarl/go-bindata-assetfs v1.0.1
github.com/elithrar/simple-scrypt v1.3.0 // indirect
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/jpillora/ansi v1.0.2 // indirect
github.com/jpillora/archive v0.0.0-20160301031048-e0b3681851f1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1T
github.com/glycerine/goconvey v0.0.0-20190315024820-982ee783a72e/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 h1:gclg6gY70GLy3PbkQ1AERPfmLMMagS60DKF78eWwLn8=
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
Expand Down
5 changes: 2 additions & 3 deletions scripts/ci_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ makebuild () {
for GM in 5 6 7; do
SUFFIX="_armv${GM}"
BINFILE=${BIN}_${OS}_${ARCH}${SUFFIX}
CGO_ENABLED=0 GOARCH=$ARCH GOARM=${GM} GOOS=$OS go build -o ${BUILDDIR}/${BINFILE} -ldflags "-s -w -X main.VERSION=$GITVER"
GOARCH=$ARCH GOARM=${GM} GOOS=$OS go build -o ${BUILDDIR}/${BINFILE} -trimpath -ldflags "-s -w -X main.VERSION=$GITVER"
pushd ${BUILDDIR}
gzip -v -9 ${BINFILE}
popd
done
else
CGO_ENABLED=0 GOARCH=$ARCH GOOS=$OS go build -o ${BUILDDIR}/${BINFILE} -ldflags "-s -w -X main.VERSION=$GITVER"
GOARCH=$ARCH GOOS=$OS go build -o ${BUILDDIR}/${BINFILE} -trimpath -ldflags "-s -w -X main.VERSION=$GITVER"
pushd ${BUILDDIR}
gzip -v -9 ${BINFILE}
popd
Expand All @@ -44,4 +44,3 @@ upstatic () {

upstatic
makebuild $BIN $1 $2

2 changes: 1 addition & 1 deletion scripts/make_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi
pushd $__dir/..
BINFILE=${BIN}_${OS}_${ARCH}${SUFFIX}
rm -fv ${BIN}_*
CGO_ENABLED=0 GOARCH=$ARCH GOOS=$OS go build -o ${BINFILE}${EXESUFFIX} -ldflags "-s -w -X main.VERSION=$GITVER"
GOARCH=$ARCH GOOS=$OS go build -o ${BINFILE}${EXESUFFIX} -trimpath -ldflags "-s -w -X main.VERSION=$GITVER"
if [[ ! -f ${BINFILE}${EXESUFFIX} ]]; then
echo "Build failed. Check with error message above."
exit 1
Expand Down
20 changes: 20 additions & 0 deletions updateplay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- hosts: cld
user: root
strategy: free
gather_facts: no
vars:
- ansible_ssh_common_args: '-o ProxyCommand="~/bin/wslhostproxy.sh %h %p"'
tasks:
- name: up
ansible.builtin.copy:
src: cloud-torrent_linux_amd64.gz
dest: /tmp/

- name: shell
shell: |
systemctl stop cloudtorrent
gzip -d -c /tmp/cloud-torrent_linux_amd64.gz > /usr/local/bin/cloud-torrent
systemctl start cloudtorrent
rm -f /tmp/cloud-torrent_linux_amd64.gz