-
Notifications
You must be signed in to change notification settings - Fork 3
175 lines (162 loc) · 5.98 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Release
on:
push:
tags: [ 'v*' ]
env:
MATURIN_VERSION: 0.13.6
jobs:
release-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: aarch64-apple-darwin
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
- name: Build
uses: messense/maturin-action@v1
with:
maturin-version: ${{ env.MATURIN_VERSION }}
args: --release --out dist --strip --universal2 -m crates/cli/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
name: apple-darwin-${{ github.ref_name }}-bin
path: target/release/domain-recon
if-no-files-found: error
release-windows:
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
platform:
- arch: x64
target: x86_64-pc-windows-msvc
- arch: x86
target: i686-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
- name: Build
uses: messense/maturin-action@v1
with:
maturin-version: ${{ env.MATURIN_VERSION }}
target: ${{ matrix.platform.target }}
args: --release --out dist --strip -m crates/cli/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.platform.arch }}-${{ github.ref_name }}-bin
path: target/${{ matrix.platform.target }}/release/domain-recon.exe
if-no-files-found: error
release-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
platform: [
{ target: "x86_64-unknown-linux-musl", image_tag: "x86_64-musl" },
{ target: "i686-unknown-linux-musl", image_tag: "i686-musl" },
{ target: "aarch64-unknown-linux-musl", image_tag: "aarch64-musl" },
{ target: "armv7-unknown-linux-musleabihf", image_tag: "armv7-musleabihf" },
{ target: "armv7-unknown-linux-musleabi", image_tag: "armv7-musleabi" },
]
container:
image: messense/rust-musl-cross:${{ matrix.platform.image_tag }}
env:
CFLAGS_armv7_unknown_linux_musleabihf: '-mfpu=vfpv3-d16'
steps:
- uses: actions/checkout@v3
- name: Store git commit
run: |
echo "DOMAIN_RECON_RS_RELEASE_GIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform.target }}
- name: Build
uses: messense/maturin-action@v1
with:
maturin-version: ${{ env.MATURIN_VERSION }}
target: ${{ matrix.platform.target }}
manylinux: auto
container: off
args: --release -o dist --strip -m crates/cli/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.target }}-${{ github.ref_name }}-bin
path: target/${{ matrix.platform.target }}/release/domain-recon
if-no-files-found: error
release-all:
name: Release all artifacts
runs-on: ubuntu-latest
needs: [ release-macos, release-windows, release-linux ]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: target/github-release
- name: Create upload directory
run: |
mkdir -p target/upload
- name: Package Windows files
working-directory: target/github-release
run: |
make -f ../../Makefile build-release-zip tag=${{ github.ref_name }} target=windows-x64
make -f ../../Makefile build-release-zip tag=${{ github.ref_name }} target=windows-x86
- name: Package MacOS files
working-directory: target/github-release
run: |
make -f ../../Makefile build-release-tar tag=${{ github.ref_name }} target=apple-darwin
- name: Package Linux files
working-directory: target/github-release
run: |
make -f ../../Makefile build-release-tar tag=${{ github.ref_name }} target=x86_64-unknown-linux-musl
make -f ../../Makefile build-release-tar tag=${{ github.ref_name }} target=i686-unknown-linux-musl
make -f ../../Makefile build-release-tar tag=${{ github.ref_name }} target=aarch64-unknown-linux-musl
make -f ../../Makefile build-release-tar tag=${{ github.ref_name }} target=armv7-unknown-linux-musleabihf
make -f ../../Makefile build-release-tar tag=${{ github.ref_name }} target=armv7-unknown-linux-musleabi
- name: Move release files to upload
run: |
mkdir -p target/upload
mv target/github-release/*.tar.gz* target/upload
mv target/github-release/*.zip* target/upload
mv target/github-release/**/*.whl target/upload
- name: Upload binaries to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: target/upload/*
prerelease: ${{ contains(github.ref_name, '-pre') }}
generate_release_notes: true
- name: Update Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
tap: recon-tools/homebrew-recon-tools
formula: domain-recon-rs
force: false