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

WIP: Feat/macos #23

Closed
wants to merge 4 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
46 changes: 46 additions & 0 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Go

on:
push:
branches: [ master ]

jobs:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0 # otherwise, push refs to dest repo will fail

- name: Run Script
run: build/linux.sh
- uses: actions/upload-artifact@v2
with:
name: go-libtor
path: /tmp/go-libtor.tar
name: Darwin
runs-on: macos-latest
needs: Linux
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Download the build from linux

- uses: actions/download-artifact@v2
with:
name: go-libtor
path: /tmp/

- name: Run Script
run: build/darwin.sh
48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `go-libtor` project is a self-contained, fully statically linked Tor library
| Library | Version | Commit |
|:--------:|:-------:|:------:|
| zlib | 1.2.11 | [`cacf7f1d4e3d44d871b605da3b647f07d718623f`](https://github.com/madler/zlib/commit/cacf7f1d4e3d44d871b605da3b647f07d718623f) |
| libevent | 2.2.0-alpha-dev | [`02428d9a2d89ee0a595166909dd6d75b5beb777b`](https://github.com/libevent/libevent/commit/02428d9a2d89ee0a595166909dd6d75b5beb777b) |
| libevent | 2.2.0-alpha-dev | [`a18301a2bb160ff7c3ffaf5b7653c39ffe27b385`](https://github.com/libevent/libevent/commit/a18301a2bb160ff7c3ffaf5b7653c39ffe27b385) |
| openssl | 1.1.1-stable | [`526cf60408e1a356ec712b6c88a88864fdbe73af`](https://github.com/openssl/openssl/commit/526cf60408e1a356ec712b6c88a88864fdbe73af) |
| tor | 0.3.5.11-dev | [`ee72c517b2cce9df02000c7c456cea07e3d2f158`](https://gitweb.torproject.org/tor.git/commit/?id=ee72c517b2cce9df02000c7c456cea07e3d2f158) |

Expand Down
48 changes: 48 additions & 0 deletions build/darwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

brew install pkg-config [email protected] autoconf automake
export PKG_CONFIG_PATH="PKG_CONFIG_PATH:/usr/local/opt/[email protected]/lib/pkgconfig/"
if [ "$?" != "0" ] ; then
echo "Install failed"
exit 1
fi

mv /tmp/go-libtor.tar .
if [ "$?" != "0" ] ; then
echo "move failed"
exit 1
fi
tar xf go-libtor.tar
if [ "$?" != "0" ] ; then
echo "unpack failed"
exit 1
fi

cd go-libtor/

go version
go env
autoconf --version
automake --version
make --version
gcc --version

echo "Building"

go run build/wrap.go
if [ "$?" != "0" ] ; then
echo "Error building"
exit 1
fi

mkdir -p .ssh
echo "$GITHUB_ED25519_KEY" > .ssh/id_ed25519

git add .
if [ -n "$(git status --porcelain)" ]; then
echo "New files, updating"
git commit --author="Jorropo-berty-bot <github@action>" -m "Updated libtor dependencies."
tag=`git describe --tags --abbrev=0` && git tag "`echo $tag | cut -d '.' -f -2`.$((`echo $tag | cut -d '.' -f 3`+1))"
fi

git push upstream master --tags
1 change: 1 addition & 0 deletions build/libtor_preamble.go.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package libtor
/*
#cgo linux,amd64,!android linux,arm64,!android CFLAGS: -DARCH_LINUX64
#cgo linux,386,!android linux,arm,!android CFLAGS: -DARCH_LINUX32
#cgo darwin,amd64 darwin,arm64 CFLAGS: -DARCH_DARWIN64
#cgo android,amd64 android,arm64 CFLAGS: -DARCH_ANDROID64
#cgo android,386 android,arm CFLAGS: -DARCH_ANDROID32
*/
Expand Down
26 changes: 26 additions & 0 deletions build/linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

sudo apt update
sudo apt install autoconf automake make libssl-dev libevent-dev zlib1g-dev -y
if [ "$?" != "0" ] ; then
echo "Install failed"
exit 1
fi

go version
go env
autoconf --version
automake --version
make --version
gcc --version

echo "Building"

go run build/wrap.go --update
if [ "$?" != "0" ] ; then
echo "Error building"
exit 1
fi

cd ..
tar cvf /tmp/go-libtor.tar go-libtor/
Loading