Merge pull request #10 from SpontanCombust:dev #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: draft-release | |
on: | |
push: | |
tags: '*' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
exec_name: rw3d_cli | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
exec_name: rw3d_cli.exe | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Use Rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Build with Cargo | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --package rw3d_cli --release --target ${{ matrix.target }} | |
- name: Zip the executable | |
uses: papeloto/action-zip@v1 | |
with: | |
files: "target/${{ matrix.target }}/release/${{ matrix.exec_name }}" | |
dest: "rw3d_cli-${{ github.ref_name }}-${{ matrix.target }}.zip" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.target }} | |
path: "*.zip" | |
if-no-files-found: error | |
publish: | |
runs-on: ubuntu-latest | |
needs: build | |
if: success() | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Prepare artifact list for release action | |
run: echo "ARTIFACTS=$(echo $(find . -iname "*.zip") | sed "s/ /,/g")" >> $GITHUB_ENV | |
- name: Create draft release on GitHub | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "${{ env.ARTIFACTS }}" | |
draft: true | |
allowUpdates: true | |
generateReleaseNotes: true |