-
-
Notifications
You must be signed in to change notification settings - Fork 6
37 lines (30 loc) · 965 Bytes
/
Create-Release.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
name: Add-Artifacts-to-Draft-Release
on:
release:
types:
- created
jobs:
add_artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up GitHub CLI
uses: actions/setup-gh-cli@v2
- name: Authenticate GitHub CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Check if release is a draft
id: check_draft
run: echo "is_draft=${{ github.event.release.draft }}" >> $GITHUB_ENV
- name: Download artifacts
if: ${{ env.is_draft == 'true' }}
uses: actions/download-artifact@v4
with:
name: firmware-*
path: ./artifacts
- name: Upload Release Assets
if: ${{ env.is_draft == 'true' }}
run: |
for file in ./artifacts/*; do
gh release upload "${{ github.event.release.tag_name }}" "$file" --clobber
done