Skip to content

Commit 10ccd1a

Browse files
committed
Explicitly separate two linux architecture build actions on GH actions
1 parent bb66812 commit 10ccd1a

File tree

2 files changed

+39
-29
lines changed

2 files changed

+39
-29
lines changed

.github/workflows/release.yml

+38-29
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,8 @@ on:
66
- 'v*'
77

88
jobs:
9-
build:
10-
strategy:
11-
matrix:
12-
include:
13-
- os: ubuntu-latest
14-
target: x86_64-unknown-linux-gnu
15-
artifact_name: anypay-websockets-linux-x86_64
16-
- os: ubuntu-latest
17-
target: aarch64-unknown-linux-gnu
18-
artifact_name: anypay-websockets-linux-arm64
19-
- os: macos-latest
20-
target: x86_64-apple-darwin
21-
artifact_name: anypay-websockets-macos-x86_64
22-
- os: macos-14 # For M1/M2
23-
target: aarch64-apple-darwin
24-
artifact_name: anypay-websockets-macos-arm64
25-
26-
runs-on: ${{ matrix.os }}
9+
build-linux-x86:
10+
runs-on: ubuntu-latest
2711

2812
steps:
2913
- uses: actions/checkout@v3
@@ -32,31 +16,56 @@ jobs:
3216
uses: actions-rs/toolchain@v1
3317
with:
3418
toolchain: stable
35-
target: ${{ matrix.target }}
19+
target: x86_64-unknown-linux-gnu
3620
override: true
3721

38-
- name: Install Cross-Compilation Tools
39-
if: matrix.target == 'aarch64-unknown-linux-gnu'
22+
- name: Build
4023
run: |
41-
sudo apt-get update
42-
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
24+
cargo build --release --target x86_64-unknown-linux-gnu
25+
tar -czf anypay-websockets-linux-x86_64.tar.gz -C target/x86_64-unknown-linux-gnu/release anypay-websockets
26+
- name: Create Release
27+
uses: softprops/action-gh-release@v1
28+
if: startsWith(github.ref, 'refs/tags/')
29+
with:
30+
files: |
31+
anypay-websockets-linux-x86_64.tar.gz
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: anypay-websockets-linux-x86_64
39+
path: target/x86_64-unknown-linux-gnu/release/anypay-websockets
40+
41+
build-linux-aarch64:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- name: Install Rust
48+
uses: actions-rs/toolchain@v1
49+
with:
50+
toolchain: stable
51+
target: aarch64-unknown-linux-gnu
52+
override: true
4353

4454
- name: Build
4555
run: |
46-
cargo build --release --target ${{ matrix.target }}
47-
tar -czf ${{ matrix.artifact_name }}.tar.gz -C target/${{ matrix.target }}/release anypay-websockets
48-
56+
cargo build --release --target aarch64-unknown-linux-gnu
57+
tar -czf anypay-websockets-linux-aarch64.tar.gz -C target/aarch64-unknown-linux-gnu/release anypay-websockets
4958
- name: Create Release
5059
uses: softprops/action-gh-release@v1
5160
if: startsWith(github.ref, 'refs/tags/')
5261
with:
5362
files: |
54-
${{ matrix.artifact_name }}.tar.gz
63+
anypay-websockets-linux-aarch64.tar.gz
5564
env:
5665
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5766

5867
- name: Upload artifact
5968
uses: actions/upload-artifact@v3
6069
with:
61-
name: ${{ matrix.artifact_name }}
62-
path: target/${{ matrix.target }}/release/anypay-websockets
70+
name: anypay-websockets-linux-aarch64
71+
path: target/aarch64-unknown-linux-gnu/release/anypay-websockets

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
target
22
.env
3+
**.swp

0 commit comments

Comments
 (0)