Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Optional upload url for release events#41

Closed
CurtisHughes wants to merge 1 commit into
actions:masterfrom
CurtisHughes:default-release-id
Closed

Optional upload url for release events#41
CurtisHughes wants to merge 1 commit into
actions:masterfrom
CurtisHughes:default-release-id

Conversation

@CurtisHughes

Copy link
Copy Markdown

This would allow users to upload assets to a release without providing an upload url.

It uses the Github context to determine if the action was a release-event-release (i.e. published, deleted, prereleased) and fetches the upload url based on the current actions release id.

on:
  release:
    types:
      - published

jobs:
  build:
    name: Upload Release Asset
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Build project # This would actually build your project, using zip for an example artifact
        run: |
          zip --junk-paths my-artifact README.md
      - name: Upload Release Asset
        id: upload-release-asset 
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          asset_path: ./my-artifact.zip
          asset_name: my-artifact.zip
          asset_content_type: application/zip

@liuchong

Copy link
Copy Markdown

I need this, actually I've made a similar change and then found this pull request 😹
Please merge 👀

@liuchong

Copy link
Copy Markdown

I provided my solution, any one is ok for me to merge: #45

@giansalex

giansalex commented Jul 7, 2020

Copy link
Copy Markdown

Is very usefull, i had to use actions/github-action-publish-binaries

@clementlecorre

Copy link
Copy Markdown

I need this too! 👍

@CurtisHughes CurtisHughes closed this by deleting the head repository Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants