Skip to content

Commit 2e081ab

Browse files
committed
ci: use GH CLI
1 parent 3d1af83 commit 2e081ab

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,22 @@ jobs:
1010
create-release:
1111
runs-on: ubuntu-22.04
1212
outputs:
13-
upload_url: ${{ steps.get_upload_url.outputs.url }}
13+
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v3
1717

18-
- name: Create Release
19-
id: create_release
20-
uses: actions/create-release@v1
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Set up GitHub CLI
19+
uses: cli/gh-action@v2
2320
with:
24-
tag_name: ${{ github.ref }}
25-
release_name: Release ${{ github.ref }}
26-
draft: true
27-
prerelease: true
21+
version: latest
2822

29-
- name: Get Upload URL
30-
id: get_upload_url
23+
- name: Create Draft Release
24+
id: create_release
3125
run: |
32-
url=$(echo "${{ steps.create_release.outputs.upload_url }}" | sed -e 's/{.*//')
33-
echo "url=$url" >> $GITHUB_OUTPUT
26+
gh release create ${{ github.ref }} --title "Release ${{ github.ref }}" --notes "Release notes for ${{ github.ref }}" --draft
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3429

3530
build-and-release:
3631
needs: create-release
@@ -81,12 +76,15 @@ jobs:
8176
with:
8277
path: ./artifacts
8378

79+
- name: Set up GitHub CLI
80+
uses: cli/gh-action@v2
81+
with:
82+
version: latest
83+
8484
- name: Upload Release Assets
85-
uses: actions/upload-release-asset@v1
85+
run: |
86+
for file in ./artifacts/*; do
87+
gh release upload ${{ github.ref }} "$file" --clobber
88+
done
8689
env:
8790
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88-
with:
89-
upload_url: ${{ needs.create-release.outputs.upload_url }}
90-
asset_path: ./artifacts/*
91-
asset_name: graphical_bootloader_${{ matrix.board.name }}.bin
92-
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)