-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (77 loc) · 2.34 KB
/
rust.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
name: Rust
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
name: build ${{ matrix.file }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
file:
# - ${{ github.event.repository.name }}
- bin1
- bin2
runs-on: ${{ matrix.os }}
# outputs:
# artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
env:
NAME: target/release/${{ matrix.file }}${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
NEW_NAME: target/release/${{ matrix.file }}-${{ github.ref_name }}-${{ matrix.os }}${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
ARTIFACT_NAME: Binary-${{ matrix.file }}-${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Build
env:
CARGO_TERM_COLOR: always
run: cargo build --release --verbose
- name: Rename files
shell: bash
run: mv $NAME $NEW_NAME
- name: Upload
uses: actions/upload-artifact@master
id: artifact-upload-step
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.NEW_NAME }}
# - name: Output artifact URL
# run: echo 'Artifact URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}'
release:
name: downloading Binary-${{ matrix.file }}-${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
file:
# - ${{ github.event.repository.name }}
- bin1
- bin2
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
env:
ARTIFACT_NAME: Binary-${{ matrix.file }}-${{ matrix.os }}
steps:
- uses: actions/download-artifact@master
with:
name: ${{ env.ARTIFACT_NAME }}
- name: List files
run: |
ls -lih
- name: GH Release for ${{ matrix.os }}
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: '*'
- name: Done
run: |
echo "### [${{ github.ref_name }}](https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ github.ref_name }}) Released! :rocket:" >> $GITHUB_STEP_SUMMARY