@@ -21,12 +21,11 @@ jobs:
21
21
- bin1
22
22
- bin2
23
23
runs-on : ${{ matrix.os }}
24
- # outputs:
25
- # artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
24
+ defaults :
25
+ run :
26
+ shell : bash
26
27
env :
27
28
NAME : ${{ format('target/release/{0}{1}', matrix.file, startsWith(matrix.os, 'windows') && '.exe' || '') }}
28
- # Can't access runner context
29
- # NEW_NAME: ${{ format('target/release/{0}-{1}-{2}{3}', matrix.file, github.ref_name, matrix.os, startsWith(matrix.os, 'windows') && '.exe' || '') }}
30
29
ARTIFACT_NAME : Binary-${{ matrix.file }}-${{ matrix.os }}
31
30
steps :
32
31
- uses : actions/checkout@master
36
35
run : cargo build --release --verbose
37
36
- name : Naming ${{ env.NEW_NAME }}
38
37
id : naming
39
- shell : bash
40
38
env :
41
39
NEW_NAME : >-
42
40
${{ format('target/release/{0}-{1}-{2}-{3}{4}',
@@ -45,53 +43,18 @@ jobs:
45
43
export NAME="$( echo ${{ env.NEW_NAME }} | tr [:upper:] [:lower:] )"
46
44
echo "FILENAME=$NAME" >> $GITHUB_OUTPUT
47
45
- name : Rename files
48
- shell : bash
49
46
run : |
50
47
mv $NAME ${{ steps.naming.outputs.FILENAME }}
51
- - name : Upload
52
- uses : actions/upload-artifact@master
53
- id : artifact-upload-step
54
- with :
55
- name : ${{ env.ARTIFACT_NAME }}
56
- # path: ${{ env.NEW_NAME }}
57
- path : ${{ steps.naming.outputs.FILENAME }}
58
- # - name: Output artifact URL
59
- # run: echo 'Artifact URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}'
60
-
61
- release :
62
- name : downloading Binary-${{ matrix.file }}-${{ matrix.os }}
63
- strategy :
64
- fail-fast : false
65
- matrix :
66
- os :
67
- - windows-latest
68
- - ubuntu-latest
69
- - macos-latest
70
- file :
71
- # - ${{ github.event.repository.name }}
72
- - bin1
73
- - bin2
74
- runs-on : ubuntu-latest
75
- needs : build
76
- if : ' !cancelled()' # always(), Same as success() || failure()
77
- permissions :
78
- contents : write
79
- env :
80
- ARTIFACT_NAME : Binary-${{ matrix.file }}-${{ matrix.os }}
81
- steps :
82
- - uses : actions/download-artifact@master
83
- with :
84
- name : ${{ env.ARTIFACT_NAME }}
85
- - name : List files
86
- run : |
87
- ls -lih
88
- - name : GH Release for ${{ matrix.os }}
48
+ - name : GH Release on ${{ matrix.os }}
89
49
90
50
if : startsWith(github.ref, 'refs/tags/')
91
51
with :
92
52
token : ${{ secrets.GITHUB_TOKEN }}
93
- files : ' * '
53
+ files : ${{ steps.naming.outputs.FILENAME }}
94
54
- name : Done
95
55
run : |
96
56
echo "### [${{ github.ref_name }}](https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ github.ref_name }}) Released! :rocket:" \
97
57
>> $GITHUB_STEP_SUMMARY
58
+
59
+ permissions :
60
+ contents : write
0 commit comments