Skip to content

Commit 4884e10

Browse files
committed
fix: attach binaries to generated releases
1 parent e0f9ba7 commit 4884e10

File tree

2 files changed

+40
-20
lines changed

2 files changed

+40
-20
lines changed
Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
on: [push]
1+
on:
2+
pull_request:
23

3-
name: Build and release
4+
name: Build
45

56
jobs:
67
build:
@@ -10,28 +11,10 @@ jobs:
1011
os: [ubuntu-latest, windows-latest, macos-latest]
1112
steps:
1213
- uses: actions/checkout@v2
13-
1414
- uses: dtolnay/rust-toolchain@stable
15-
1615
- uses: Swatinem/rust-cache@v1
1716

1817
- name: Build in debug mode
19-
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
20-
uses: actions-rs/cargo@v1
21-
with:
22-
command: build
23-
24-
- name: Build in release mode (if tagged version)
25-
if: startsWith(github.ref, 'refs/tags/v')
2618
uses: actions-rs/cargo@v1
2719
with:
2820
command: build
29-
args: --release
30-
31-
- name: Prefix binary name
32-
run: cp target/release/aoede target/release/${{ matrix.os }}-aoede
33-
continue-on-error: true
34-
35-
- name: Prefix binary name
36-
run: cp target/release/aoede.exe target/release/${{ matrix.os }}-aoede.exe
37-
continue-on-error: true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*.*.*'
5+
6+
name: Build binaries for release
7+
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: dtolnay/rust-toolchain@stable
17+
- uses: Swatinem/rust-cache@v1
18+
- name: Build in release mode
19+
uses: actions-rs/cargo@v1
20+
with:
21+
command: build
22+
args: --release
23+
24+
- name: Prefix binary name
25+
run: cp target/release/aoede target/release/${{ matrix.os }}-aoede
26+
continue-on-error: true
27+
28+
- name: Prefix binary name
29+
run: cp target/release/aoede.exe target/release/${{ matrix.os }}-aoede.exe
30+
continue-on-error: true
31+
32+
- name: Add to release
33+
uses: softprops/action-gh-release@v1
34+
with:
35+
files: target/release/*-aoede!(*.d|*.pdb)
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)