Skip to content

Commit 0f46d43

Browse files
ci/cd: build also linux target
1 parent 1d9009a commit 0f46d43

1 file changed

Lines changed: 36 additions & 8 deletions

File tree

.github/workflows/draft-release.yml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,58 @@ env:
99

1010
jobs:
1111
build:
12-
runs-on: windows-latest
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
exec_name: rw3d_cli
18+
- os: windows-latest
19+
target: x86_64-pc-windows-msvc
20+
exec_name: rw3d_cli.exe
1321

14-
steps:
22+
runs-on: ${{ matrix.os }}
1523
- name: Checkout
1624
uses: actions/checkout@v2
1725
- name: Use Rust stable
1826
uses: actions-rs/toolchain@v1
1927
with:
2028
toolchain: stable
21-
target: x86_64-pc-windows-msvc
29+
target: ${{ matrix.target }}
2230
override: true
2331
- name: Build with Cargo
2432
uses: actions-rs/cargo@v1
2533
with:
2634
command: build
27-
args: --package rw3d_cli --release --target=x86_64-pc-windows-msvc
35+
args: --package rw3d_cli --release --target ${{ matrix.target }}
36+
2837
- name: Zip the executable
2938
uses: papeloto/action-zip@v1
3039
with:
31-
files: "target/x86_64-pc-windows-msvc/release/rw3d_cli.exe"
32-
dest: "rw3d_cli_${{ github.ref_name }}.zip"
33-
- name: Create draft release
40+
files: "target/${{ matrix.target }}/release/${{ matrix.exec_name }}"
41+
dest: "rw3d_cli-${{ github.ref_name }}-${{ matrix.target }}.zip"
42+
- name: Upload artifacts
43+
uses: actions/upload-artifact@v2
44+
with:
45+
name: ${{ matrix.target }}
46+
path: "*.zip"
47+
if-no-files-found: error
48+
49+
publish:
50+
runs-on: ubuntu-latest
51+
needs: build
52+
if: success()
53+
54+
steps:
55+
- name: Download artifacts
56+
uses: actions/download-artifact@v2
57+
58+
- name: Prepare artifact list for release action
59+
run: echo "ARTIFACTS=$(echo $(find . -iname "*.zip") | sed "s/ /,/g")" >> $GITHUB_ENV
60+
- name: Create draft release on GitHub
3461
uses: ncipollo/release-action@v1
3562
with:
36-
artifacts: "rw3d_cli_${{ github.ref_name }}.zip"
63+
artifacts: "${{ env.ARTIFACTS }}"
3764
draft: true
65+
allowUpdates: true
3866
generateReleaseNotes: true

0 commit comments

Comments
 (0)