forked from paradigmxyz/pyrevm
-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (122 loc) · 4.16 KB
/
release.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: release
on: workflow_dispatch
jobs:
linux:
runs-on: ubuntu-latest
container:
image: messense/rust-musl-cross:aarch64-musl
steps:
- uses: actions/checkout@v3
- name: Install OpenSSL
run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config
- name: Set OpenSSL Environment Variables
run: |
echo "OPENSSL_DIR=/usr" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/usr/include" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV
- name: Verify OpenSSL Installation and Env Vars
run: |
echo "OPENSSL_DIR=$OPENSSL_DIR"
echo "OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR"
echo "OPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
openssl version
pkg-config --libs --cflags openssl
- name: Cleanup dist directory
run: rm -rf dist/
- name: Install maturin
run: pip install maturin
- name: Install Rust target for ARM64
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: aarch64-unknown-linux-gnu
override: true
- name: Install cross-compiling tools for ARM64
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt-get install musl-tools
- name: Set Environment Variables for ARM64 build
run: |
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build arm64 Wheels
run: maturin build --release --out dist/arm64 --find-interpreter --target aarch64-unknown-linux-gnu
env:
CARGO_TERM_COLOR: always
CC: aarch64-linux-gnu-gcc
OPENSSL_DIR: /usr
- name: Build amd64 Wheels
run: maturin build --release --out dist/amd64 --find-interpreter --target x86_64-unknown-linux-gnu
env:
CARGO_TERM_COLOR: always
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels-linux
path: dist/
# windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install OpenSSL
# run: choco install openssl
# - name: Build and Prepare Wheels
# uses: messense/maturin-action@v1
# with:
# command: build
# args: --release -o dist --find-interpreter
# - name: List built wheels
# run: ls dist/
# - name: Upload wheels
# uses: actions/upload-artifact@v2
# with:
# name: wheels-windows
# path: dist
# macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install OpenSSL
# run: brew install openssl
# - name: Build and Prepare Wheels
# uses: messense/maturin-action@v1
# with:
# command: build
# args: --release -o dist --universal2 --find-interpreter
# - name: List built wheels
# run: ls dist/
# - name: Upload wheels
# uses: actions/upload-artifact@v2
# with:
# name: wheels-macos
# path: dist
release:
name: Release
runs-on: ubuntu-latest
needs: [ linux]
steps:
- name: Download all wheels (Linux)
uses: actions/download-artifact@v2
with:
name: wheels-linux
- name: Download all wheels (Windows)
uses: actions/download-artifact@v2
with:
name: wheels-windows
- name: Download all wheels (macOS)
uses: actions/download-artifact@v2
with:
name: wheels-macos
- name: List all downloaded wheels
run: ls
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing *