forked from TimeToogo/tunshell
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (97 loc) · 3.47 KB
/
deploy-client-binaries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Publish Client Libraries
on:
push:
branches:
- master
jobs:
build_test_deploy:
continue-on-error: true
strategy:
matrix:
include:
# Linux
- platform: ubuntu-latest
target: x86_64-unknown-linux-musl
tests: true
- platform: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- platform: ubuntu-latest
target: aarch64-unknown-linux-musl
tests: true
rustflags: -C link-arg=-lgcc # from https://github.com/rust-embedded/cross/blob/master/docker/Dockerfile.aarch64-unknown-linux-musl
- platform: ubuntu-latest
target: arm-unknown-linux-musleabi
tests: true
- platform: ubuntu-latest
target: arm-linux-androideabi
- platform: ubuntu-latest
target: aarch64-linux-android
- platform: ubuntu-latest
target: i686-unknown-linux-musl
tests: true
- platform: ubuntu-latest
target: i586-unknown-linux-musl
tests: true
- platform: ubuntu-latest
target: mips-unknown-linux-musl
rustflags: --cfg openssl
- platform: ubuntu-latest
target: x86_64-unknown-freebsd
cc: x86_64-unknown-freebsd12-gcc
# Apple
- platform: macos-latest
target: x86_64-apple-darwin
tests: true
- platform: macos-latest
target: x86_64-apple-ios
- platform: macos-latest
target: aarch64-apple-darwin
# Windows
- platform: windows-latest
target: x86_64-pc-windows-msvc
tests: true
rustflags: -C target-feature=+crt-static
- platform: windows-latest
target: i686-pc-windows-msvc
rustflags: -C target-feature=+crt-static
# iSH (https://ish.app/)
- platform: ubuntu-latest
target: i686-unknown-linux-musl
client_binary_name: ish
tests: false
rustflags: -C target-feature=-mmx,-sse,-sse2 --cfg tls_only_aes_gcm
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- run: ./install-deps.sh
working-directory: tunshell-client/build
shell: bash
env:
TEMPDIR: /tmp
- run: ./compile.sh ${{ matrix.target }} $PWD/artifacts/client
working-directory: tunshell-client/build
shell: bash
env:
RUN_TESTS: ${{ matrix.tests }}
RUST_TEST_THREADS: 1
CI: true
RUST_LOG: debug
RUSTFLAGS: ${{ matrix.rustflags }}
CC: ${{ matrix.cc }}
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ARTIFACT_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ARTIFACT_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# Deploy artifact to https://artifacts.tunshell.com
- name: Deploy to S3
run: >
aws s3 cp $PWD/artifacts/client s3://tunshell-artifacts/client-${{ matrix.client_binary_name || matrix.target }}
--acl=public-read
--cache-control max-age=31536000
--metadata "sha256=$(openssl sha256 -r $PWD/artifacts/client | awk '{print $1}')"
--metadata-directive REPLACE
working-directory: tunshell-client/build
shell: bash
- name: Invalidate CloudFront
run: aws cloudfront create-invalidation --distribution-id=E3DF4SGU15BNWT --paths '/*'