Skip to content

Add release-assets action#61

Merged
balloob merged 2 commits intohome-assistant:masterfrom
cdce8p:release-assets
Mar 15, 2022
Merged

Add release-assets action#61
balloob merged 2 commits intohome-assistant:masterfrom
cdce8p:release-assets

Conversation

@cdce8p
Copy link
Copy Markdown
Member

@cdce8p cdce8p commented Feb 7, 2022

Helper action to upload sdists and wheels as release assets.
Could be used for home-assistant/frontend#11566 and eventually Core.

@cdce8p cdce8p requested a review from ludeeus February 10, 2022 13:23
@ludeeus ludeeus removed their request for review February 10, 2022 13:24
@balloob balloob merged commit 4f3d299 into home-assistant:master Mar 15, 2022
@cdce8p cdce8p deleted the release-assets branch March 15, 2022 12:54
if: github.event_name != 'release'
shell: bash
run: |
echo "Action can only be run for 'release' events"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use echo "::error::[message] so it's properly displayed in the UI.

run: |
API_REQUEST=$(curl -sS \
-H "Accept: application/vnd.github.v3+json" \
${{ github.event.release.assets_url }})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use authentication when accessing the GitHub API so this does not randomly fail due to rate-limits.

fi
- name: Upload release asset (sdist)
if: ${{ !steps.existing-assets.outputs.sdist-found }}
uses: actions/upload-release-asset@v1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants