Skip to content

Commit 7917636

Browse files
committed
test
1 parent f3a49ee commit 7917636

File tree

1 file changed

+8
-45
lines changed

1 file changed

+8
-45
lines changed

.github/workflows/rust.yml

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ jobs:
2121
- bin1
2222
- bin2
2323
runs-on: ${{ matrix.os }}
24-
# outputs:
25-
# artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
24+
defaults:
25+
run:
26+
shell: bash
2627
env:
2728
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' || '') }}
3029
ARTIFACT_NAME: Binary-${{ matrix.file }}-${{ matrix.os }}
3130
steps:
3231
- uses: actions/checkout@master
@@ -36,7 +35,6 @@ jobs:
3635
run: cargo build --release --verbose
3736
- name: Naming ${{ env.NEW_NAME }}
3837
id: naming
39-
shell: bash
4038
env:
4139
NEW_NAME: >-
4240
${{ format('target/release/{0}-{1}-{2}-{3}{4}',
@@ -45,53 +43,18 @@ jobs:
4543
export NAME="$( echo ${{ env.NEW_NAME }} | tr [:upper:] [:lower:] )"
4644
echo "FILENAME=$NAME" >> $GITHUB_OUTPUT
4745
- name: Rename files
48-
shell: bash
4946
run: |
5047
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 }}
8949
uses: softprops/[email protected]
9050
if: startsWith(github.ref, 'refs/tags/')
9151
with:
9252
token: ${{ secrets.GITHUB_TOKEN }}
93-
files: '*'
53+
files: ${{ steps.naming.outputs.FILENAME }}
9454
- name: Done
9555
run: |
9656
echo "### [${{ github.ref_name }}](https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ github.ref_name }}) Released! :rocket:" \
9757
>> $GITHUB_STEP_SUMMARY
58+
59+
permissions:
60+
contents: write

0 commit comments

Comments
 (0)