Skip to content

Commit 211966f

Browse files
authored
Merge branch 'danielpaulus:main' into main
2 parents 289f2a8 + fe46efe commit 211966f

File tree

113 files changed

+6905
-725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+6905
-725
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/deploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
deploy:
7+
name: Deploy my app
8+
9+
runs-on: self-hosted
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Extract ngrok url
14+
run: |
15+
echo "NGROK_URL=$(curl -s localhost:4040/api/tunnels | jq -r ".tunnels[0].public_url")" >> $GITHUB_ENV
16+
curl -s localhost:4040/api/tunnels | jq ".tunnels[0].public_url"
17+
cat $GITHUB_ENV
18+
- uses: chrnorm/deployment-action@v2
19+
name: Create GitHub deployment
20+
id: deployment
21+
with:
22+
token: '${{ github.token }}'
23+
environment-url: ${{ env.NGROK_URL }}
24+
environment: staging
25+
- name: Install Go
26+
uses: actions/setup-go@v2
27+
with:
28+
go-version: 1.17.x
29+
- name: Checkout code
30+
uses: actions/checkout@v2
31+
- name: kill old server
32+
run: systemctl --user stop goios
33+
- name: compile
34+
run: |
35+
cd restapi
36+
go install github.com/swaggo/swag/cmd/swag@latest
37+
swag init
38+
go build
39+
- name: Deploy my app
40+
run: |
41+
cd restapi
42+
cp ./restapi /home/ganjalf/
43+
rm -rf /home/ganjalf/docs
44+
mkdir /home/ganjalf/docs
45+
cp -R ./docs /home/ganjalf/docs
46+
systemctl --user start goios
47+
48+
- name: Update deployment status (success)
49+
if: success()
50+
uses: chrnorm/deployment-status@v2
51+
with:
52+
token: '${{ github.token }}'
53+
environment-url: ${{ steps.deployment.outputs.environment_url }}
54+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
55+
state: 'success'
56+
57+
- name: Update deployment status (failure)
58+
if: failure()
59+
uses: chrnorm/deployment-status@v2
60+
with:
61+
token: '${{ github.token }}'
62+
environment-url: ${{ steps.deployment.outputs.environment_url }}
63+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
64+
state: 'failure'

.github/workflows/real-device.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
ngrok:
5+
description: 'ngrok host:port'
6+
required: true
7+
default: ''
8+
udid:
9+
description: 'device udid'
10+
required: true
11+
default: ''
12+
# run this locally to get a device exposed on ngrok
13+
# ngrok tcp 9999
14+
# socat TCP-LISTEN:9999,reuseaddr,fork UNIX-CONNECT:/var/run/usbmuxd
15+
name: CI Real Device Test
16+
jobs:
17+
sign_app_on_mac:
18+
runs-on: macos-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
- name: create profile
23+
run: |
24+
echo $P12_FILE | base64 --decode > testdata/test1.p12
25+
echo $PROFILE | base64 --decode > testdata/test1.mobileprovision
26+
shell: bash
27+
env:
28+
P12_FILE: ${{secrets.P12}}
29+
PROFILE: ${{secrets.PROFILE}}
30+
- name: Run App Signer
31+
run: |
32+
testdata/app-signer-mac --udid=$UDID --p12password=$P12_PW --profilespath=testdata --ipa=testdata/wda.ipa --output=testdata/wda-signed.ipa
33+
env:
34+
P12_PW: ${{secrets.P12PASSWORD}}
35+
UDID: ${{ github.event.inputs.udid }}
36+
- name: delete profiles
37+
if: always()
38+
run: |
39+
rm testdata/test1*
40+
- name: upload the macos build
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: signed-wda
44+
path: testdata/wda-signed.ipa
45+
retention-days: 1
46+
test_on_windows:
47+
runs-on: windows-latest
48+
needs: sign_app_on_mac
49+
env:
50+
UDID: ${{ github.event.inputs.udid }}
51+
steps:
52+
- uses: actions/cache@v2 # https://github.com/actions/cache/blob/main/examples.md#go---modules
53+
with:
54+
path: |
55+
%LocalAppData%\go-build
56+
~/go/pkg/mod
57+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
58+
restore-keys: |
59+
${{ runner.os }}-go-
60+
- name: Install Go
61+
uses: actions/setup-go@v2
62+
with:
63+
go-version: 1.17.x
64+
- name: Checkout code
65+
uses: actions/checkout@v2
66+
- name: compile
67+
run: go build
68+
- name: Download mac signed wda from previous job
69+
uses: actions/download-artifact@v2
70+
with:
71+
name: signed-wda
72+
- name: extract ipa #github auto zips artifacts after a workflow is complete so we need to unzip the ipa
73+
#as it is now double zipped
74+
run: Expand-Archive -Force wda-signed.ipa testdata/signed-wda.ipa
75+
- name: forward ngrok
76+
run: netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=27015 connectaddress=$($env:NGROK_URL.Split(":")[0]) connectport=$($env:NGROK_URL.Split(":")[1])
77+
env:
78+
NGROK_URL: ${{ github.event.inputs.ngrok }}
79+
- name: test list
80+
run: go run main.go list
81+
- name: install relative
82+
run: go run main.go install --path testdata\signed-wda.ipa --udid=$($env:UDID)
83+
- name: install absolute
84+
run: go run main.go install --path $PWD\testdata\signed-wda.ipa --udid=$($env:UDID)
85+
86+
test_on_linux:
87+
runs-on: ubuntu-latest
88+
env:
89+
UDID: ${{ github.event.inputs.udid }}
90+
needs:
91+
- sign_app_on_mac
92+
- test_on_windows
93+
steps:
94+
- uses: actions/cache@v2
95+
with:
96+
path: |
97+
~/.cache/go-build
98+
~/go/pkg/mod
99+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
100+
restore-keys: |
101+
${{ runner.os }}-go-
102+
- name: Install Go
103+
uses: actions/setup-go@v2
104+
with:
105+
go-version: 1.17.x
106+
- name: Checkout code
107+
uses: actions/checkout@v2
108+
- name: Download mac release from previous job
109+
uses: actions/download-artifact@v2
110+
with:
111+
name: signed-wda
112+
- name: extract
113+
run: |
114+
mv wda-signed.ipa testdata/signed-wda.ipa
115+
- name: compile
116+
run: go build
117+
- name: install socat
118+
run: sudo apt install socat
119+
- name: ngrok
120+
run: sudo socat UNIX-LISTEN:/var/run/usbmuxd,fork,mode=777 TCP-CONNECT:$NGROK_URL&
121+
env:
122+
NGROK_URL: ${{ github.event.inputs.ngrok }}
123+
- name: test list
124+
run: go run main.go list
125+
- name: install relative
126+
run: go run main.go install --path testdata/signed-wda.ipa --udid=$UDID
127+

.github/workflows/release.yml

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
- main
55
name: Release-Go-iOS
66
jobs:
7-
build_on_mac:
8-
runs-on: macos-latest
7+
build_on_windows:
8+
runs-on: windows-latest
99
steps:
1010
- name: Create Release
1111
id: create_release
@@ -20,15 +20,47 @@ jobs:
2020
go-version: 1.17.x
2121
- name: Checkout code
2222
uses: actions/checkout@v2
23+
- name: Build
24+
run: |
25+
((Get-Content -path main.go -Raw) -replace "local-build","${{ steps.create_release.outputs.current_tag }}") | Set-Content -Path main.go
26+
mkdir bin
27+
go build -ldflags="-s -w" -o bin/ios.exe
28+
"${{ steps.create_release.outputs.current_tag }}" | Out-File -Encoding utf8NoBOM release_tag -NoNewline
29+
Compress-Archive -Path .\bin\ios.exe, release_tag -CompressionLevel Optimal -DestinationPath go-ios-windows.zip
30+
- name: upload the windows build
31+
uses: actions/upload-artifact@v2
32+
with:
33+
name: windows-build
34+
path: go-ios-windows.zip
35+
retention-days: 1
36+
build_on_mac:
37+
runs-on: macos-latest
38+
needs: build_on_windows
39+
steps:
40+
- name: Install Go
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: 1.17.x
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
- name: Download win release from previous job
47+
uses: actions/download-artifact@v2
48+
with:
49+
name: windows-build
50+
path: ./win-bin
51+
- name: Extract release tag
52+
run: |
53+
unzip go-ios-windows.zip
54+
echo "release_tag="$(cat release_tag) >> $GITHUB_ENV
55+
working-directory: ./win-bin
2356
- name: Build
2457
run: |
2558
brew install gnu-sed
2659
alias sed=gsed
27-
gsed -i 's/version \= \"local-build\"/version = \"${{ steps.create_release.outputs.current_tag }}\"/' main.go
60+
gsed -i 's/version \= \"local-build\"/version = \"${{ env.release_tag }}\"/' main.go
2861
mkdir bin
2962
go build -ldflags="-s -w" -o bin/ios
30-
echo ${{ steps.create_release.outputs.current_tag }} > release_tag
31-
zip -j go-ios-mac.zip bin/ios release_tag
63+
zip -j go-ios-mac.zip bin/ios
3264
- name: upload the macos build
3365
uses: actions/upload-artifact@v2
3466
with:
@@ -53,19 +85,48 @@ jobs:
5385
- name: Download and package mac binary
5486
run: |
5587
unzip go-ios-mac.zip
56-
echo "release_tag="$(cat release_tag) >> $GITHUB_ENV
5788
rm go-ios-mac.zip
5889
zip -j go-ios-mac.zip ios
5990
working-directory: ./mac-bin
91+
- name: Download windows release from previous job
92+
uses: actions/download-artifact@v2
93+
with:
94+
name: windows-build
95+
path: ./win-bin
96+
- name: Download and package windows binary
97+
run: |
98+
unzip go-ios-windows.zip
99+
echo "release_tag="$(cat release_tag) >> $GITHUB_ENV
100+
rm go-ios-windows.zip
101+
zip -j go-ios-win.zip ios.exe
102+
working-directory: ./win-bin
60103
- name: Build
61104
run: |
62105
sed -i 's/version \= \"local-build\"/version = \"${{ env.release_tag }}\"/' main.go
63106
mkdir bin
64107
go build -ldflags="-s -w" -o bin/ios
65108
cp ./mac-bin/go-ios-mac.zip .
109+
cp ./win-bin/go-ios-win.zip .
66110
zip -j go-ios-linux.zip bin/ios
67111
- uses: AButler/[email protected]
68112
with:
69113
files: "*.zip"
70114
repo-token: ${{ secrets.GITHUB_TOKEN }}
71115
release-tag: ${{ env.release_tag }}
116+
- name: Publish NPM
117+
run: |
118+
mkdir ./npm_publish/dist
119+
mkdir ./npm_publish/dist/go-ios-darwin-amd64_darwin_amd64
120+
mkdir ./npm_publish/dist/go-ios-linux-amd64_linux_amd64
121+
mkdir ./npm_publish/dist/go-ios-windows-amd64_windows_amd64
122+
cp ./mac-bin/ios ./npm_publish/dist/go-ios-darwin-amd64_darwin_amd64/ios
123+
cp ./win-bin/ios.exe ./npm_publish/dist/go-ios-windows-amd64_windows_amd64/ios.exe
124+
cp ./bin/ios ./npm_publish/dist/go-ios-linux-amd64_linux_amd64/ios
125+
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
126+
cd npm_publish
127+
sed -i 's/\"local-build\"/\"${{ env.release_tag }}\"/' package.json
128+
npm install
129+
npm publish
130+
env:
131+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
132+

0 commit comments

Comments
 (0)