Skip to content

Commit c6692d0

Browse files
committed
release
1 parent 9fe1608 commit c6692d0

File tree

1 file changed

+32
-43
lines changed

1 file changed

+32
-43
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,42 @@
1-
name: Build Binaries
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.*
27

3-
on:
4-
release:
5-
types: # This configuration does not affect the page_build event above
6-
- created
78
jobs:
8-
build_for_mac:
9-
name: MacOS
10-
runs-on: macos-10.15
9+
create-release:
10+
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@master
13-
- uses: actions-rs/cargo@v1
14-
with:
15-
command: build
16-
args: --release
17-
- name: Rename binary
18-
run: mv target/release/scant3r scant3r-macos64
19-
- name: strip
20-
run: strip scant3r-macos64
21-
- name: Upload to release
12+
- uses: actions/checkout@v3
13+
- uses: taiki-e/create-gh-release-action@v1
2214
env:
15+
# (required)
2316
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
run: |
25-
curl \
26-
-f \
27-
-sSL \
28-
-XPOST \
29-
-H "Authorization: token $GITHUB_TOKEN" \
30-
-H "Content-Length: $(stat -f%z scant3r-macos64)" \
31-
-H "Content-Type: application/octet-stream" \
32-
--upload-file "scant3r-macos64" \
33-
"https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)/assets?name=scant3r-macos64"
3417

35-
build_for_linux:
36-
name: Linux
37-
runs-on: ubuntu-18.04
18+
upload-assets:
19+
strategy:
20+
matrix:
21+
os:
22+
- ubuntu-latest
23+
- macos-latest
24+
- windows-latest
25+
runs-on: ${{ matrix.os }}
3826
steps:
39-
- uses: actions/checkout@master
40-
- uses: actions-rs/cargo@v1
41-
with:
42-
command: build
43-
args: --release
44-
- name: Rename binary
45-
run: mv target/release/scant3r scant3r-linux-amd64
46-
- name: strip
47-
run: strip scant3r-linux-amd64
48-
- name: Upload to release
49-
uses: JasonEtco/upload-to-release@d648f1babf776de9cad881320bd9e9818fc3b262
27+
- uses: actions/checkout@v3
28+
- uses: taiki-e/upload-rust-binary-action@v1
5029
with:
51-
args: scant3r-linux-amd64 application/octet-stream
30+
# (required)
31+
bin: scant3r
32+
# (optional) On which platform to distribute the `.tar.gz` file.
33+
# [default value: unix]
34+
# [possible values: all, unix, windows, none]
35+
tar: unix
36+
# (optional) On which platform to distribute the `.zip` file.
37+
# [default value: windows]
38+
# [possible values: all, unix, windows, none]
39+
zip: windows
5240
env:
41+
# (required)
5342
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)