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

Optional upload url for release events #41

Closed
wants to merge 1 commit into from
Closed

Optional upload url for release events #41

wants to merge 1 commit into from

Conversation

CurtisHughes
Copy link

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

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

@liuchong
Copy link

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

@giansalex
Copy link

giansalex commented Jul 7, 2020

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

@clementlecorre
Copy link

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