99 TAG : ${{ github.event.release.tag_name }} # had some issue using this directly on windows
1010
1111jobs :
12+ linux :
13+ runs-on : ubuntu-18.04
14+ strategy :
15+ matrix :
16+ target : [x86_64-unknown-linux-gnu, i686-unknown-linux-gnu, aarch64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf]
17+ steps :
18+ - uses : actions/checkout@v2
19+ - uses : actions/setup-node@v2
20+ with :
21+ node-version : ' 16'
22+ - uses : GoogleCloudPlatform/github-actions/setup-gcloud@master
23+ with :
24+ project_id : ${{ secrets.GCP_PROJECT_ID }}
25+ service_account_key : ${{ secrets.GCP_SA_KEY }}
26+ - name : Install dependencies
27+ run : |
28+ sudo apt update
29+ sudo apt install -y gcc-multilib # required to build for 32-bit arch
30+
31+ - name : Install aarch64-unknown-linux-gnu linker
32+ if : ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
33+ run : sudo apt install -y gcc-aarch64-linux-gnu
34+ - name : Install armv7-unknown-linux-gnueabihf linker
35+ if : ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
36+ run : sudo apt install -y gcc-arm-linux-gnueabihf
37+
38+ - name : Deploy
39+ run : |
40+ rustup target add ${{ matrix.target }}
41+
42+ # build and deploy CLI
43+ cargo build -p tmc-langs-cli --release --verbose --target ${{ matrix.target }}
44+ gsutil cp target/${{ matrix.target }}/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-${{ matrix.target }}-$TAG
45+
46+ # build and deploy Node module
47+ npm --prefix ./bindings/tmc-langs-node install
48+ npm --prefix ./bindings/tmc-langs-node run build -- --release --target ${{ matrix.target }}
49+ gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-${{ matrix.target }}-$TAG.node
50+
1251 windows :
1352 runs-on : windows-latest
1453 strategy :
@@ -23,10 +62,10 @@ jobs:
2362 with :
2463 project_id : ${{ secrets.GCP_PROJECT_ID }}
2564 service_account_key : ${{ secrets.GCP_SA_KEY }}
26- - name : Build # crt-static is set with RUSTFLAGS to statically link MSVCRT (VCRUNTIME140.dll)
65+ - name : Build
2766 run : |
2867 rustup target add ${{ matrix.target }}
29- $env:RUSTFLAGS="-C target-feature=+crt-static"
68+ $env:RUSTFLAGS="-C target-feature=+crt-static" # crt-static is set with RUSTFLAGS to statically link MSVCRT (VCRUNTIME140.dll)
3069 cargo build -p tmc-langs-cli --release --verbose --target ${{ matrix.target }}
3170 cd ./bindings/tmc-langs-node && npm install && npm run build -- --release --target ${{ matrix.target }}
3271 - name : Deploy
5897 run : |
5998 gsutil cp target/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-x86_64-apple-darwin-$TAG
6099 gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-x86_64-apple-darwin-$TAG.node
61-
62- ubuntu :
63- runs-on : ubuntu-18.04
64- steps :
65- - uses : actions/checkout@v2
66- - uses : actions/setup-node@v2
67- with :
68- node-version : ' 16'
69- - uses : GoogleCloudPlatform/github-actions/setup-gcloud@master
70- with :
71- project_id : ${{ secrets.GCP_PROJECT_ID }}
72- service_account_key : ${{ secrets.GCP_SA_KEY }}
73- - name : Install dependencies
74- run : |
75- sudo apt update
76- sudo apt install -y gcc-multilib # required to build for 32-bit arch
77- sudo apt install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf # linkers for ARM targets
78-
79- - name : x86_64-unknown-linux-gnu
80- env :
81- TARGET : x86_64-unknown-linux-gnu
82- run : |
83- # build and deploy CLI
84- rustup target add $TARGET
85- cargo build -p tmc-langs-cli --release --verbose --target $TARGET
86- gsutil cp target/$TARGET/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-$TARGET-$TAG
87-
88- # build and deploy Node module
89- npm --prefix ./bindings/tmc-langs-node install
90- npm --prefix ./bindings/tmc-langs-node run build -- --release --target $TARGET
91- gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-$TARGET-$TAG.node
92-
93- - name : i686-unknown-linux-gnu
94- env :
95- TARGET : i686-unknown-linux-gnu
96- run : |
97- # build and deploy CLI
98- rustup target add $TARGET
99- cargo build -p tmc-langs-cli --release --verbose --target $TARGET
100- gsutil cp target/$TARGET/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-$TARGET-$TAG
101-
102- # build and deploy Node module
103- npm --prefix ./bindings/tmc-langs-node install
104- npm --prefix ./bindings/tmc-langs-node run build -- --release --target $TARGET
105- gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-$TARGET-$TAG.node
106-
107- - name : aarch64-unknown-linux-gnu
108- env :
109- TARGET : aarch64-unknown-linux-gnu
110- run : |
111- # build and deploy CLI
112- rustup target add $TARGET
113- cargo build -p tmc-langs-cli --release --verbose --target $TARGET
114- gsutil cp target/$TARGET/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-$TARGET-$TAG
115-
116- # build and deploy Node module
117- npm --prefix ./bindings/tmc-langs-node install
118- npm --prefix ./bindings/tmc-langs-node run build -- --release --target $TARGET
119- gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-$TARGET-$TAG.node
120-
121- - name : armv7-unknown-linux-gnueabihf
122- env :
123- TARGET : armv7-unknown-linux-gnueabihf
124- run : |
125- # build and deploy CLI
126- rustup target add $TARGET
127- cargo build -p tmc-langs-cli --release --verbose --target $TARGET
128- gsutil cp target/$TARGET/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-$TARGET-$TAG
129-
130- # build and deploy Node module
131- npm --prefix ./bindings/tmc-langs-node install
132- npm --prefix ./bindings/tmc-langs-node run build -- --release --target $TARGET
133- gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-$TARGET-$TAG.node
0 commit comments