Git Product home page Git Product logo

upload-release-action's Introduction

Upload files to a GitHub release GitHub Actions Workflow

This action allows you to select which files to upload to the just-tagged release. It runs on all operating systems types offered by GitHub.

Input variables

You must provide:

  • file: A local file to be uploaded as the asset.

Optional Arguments

  • repo_token: Defaults to github.token.
  • tag: The tag to upload into. If you want the current event's tag or branch name, use ${{ github.ref }} (the refs/tags/ and refs/heads/ prefixes will be automatically stripped). Defaults to github.ref.
  • asset_name: The name the file gets as an asset on a release. Use $tag to include the tag name. When not provided it will default to the filename. This is not used if file_glob is set to true.
  • file_glob: If set to true, the file argument can be a glob pattern (asset_name is ignored in this case) (Default: false)
  • overwrite: If an asset with the same name already exists, overwrite it (Default: false).
  • promote: If a prerelease already exists, promote it to a release (Default: false).
  • draft: Sets the release as a draft instead of publishing it, allowing you to make any edits needed before releasing (Default: false).
  • prerelease: Mark the release as a pre-release (Default: false).
  • make_latest: Mark the release as the latest release for the repository (Default: true).
  • release_name: Explicitly set a release name. (Defaults: implicitly same as tag via GitHub API).
  • target_commit: Sets the commit hash or branch for the tag to be based on (Default: the default branch, usually main).
  • body: Content of the release text (Default: "").
  • repo_name: Specify the name of the GitHub repository in which the GitHub release will be created, edited, and deleted. If the repository is other than the current, it is required to create a personal access token with repo, user, admin:repo_hook scopes to the foreign repository and add it as a secret. (Default: current repository).

Output variables

  • browser_download_url: The publicly available URL of the asset.

Usage

This usage assumes you want to build on tag creations only. This is a common use case as you will want to upload release binaries for your tags.

Simple example:

name: Publish

on:
  push:
    tags:
      - '*'

jobs:
  build:
    name: Publish binaries
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Build
      run: cargo build --release
    - name: Upload binaries to release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: target/release/mything
        asset_name: mything
        tag: ${{ github.ref }}
        overwrite: true
        body: "This is my release text"

Complex example with more operating systems:

name: Publish

on:
  push:
    tags:
      - '*'

jobs:
  publish:
    name: Publish for ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            artifact_name: mything
            asset_name: mything-linux-amd64
          - os: windows-latest
            artifact_name: mything.exe
            asset_name: mything-windows-amd64
          - os: macos-latest
            artifact_name: mything
            asset_name: mything-macos-amd64

    steps:
    - uses: actions/checkout@v3
    - name: Build
      run: cargo build --release --locked
    - name: Upload binaries to release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: target/release/${{ matrix.artifact_name }}
        asset_name: ${{ matrix.asset_name }}
        tag: ${{ github.ref }}

Example with file_glob:

name: Publish
on:
  push:
    tags:
      - '*'

jobs:
  build:
    name: Publish binaries
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Build
      run: cargo build --release
    - name: Upload binaries to release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: target/release/my*
        tag: ${{ github.ref }}
        overwrite: true
        file_glob: true

Example for creating a release in a foreign repository using repo_name:

name: Publish

on:
  push:
    tags:
      - '*'

jobs:
  build:
    name: Publish binaries
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Build
      run: cargo build --release
    - name: Upload binaries to release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_name: owner/repository-name
        # A personal access token for the GitHub repository in which the release will be created and edited.
        # It is recommended to create the access token with the following scopes: `repo, user, admin:repo_hook`.
        repo_token: ${{ secrets.YOUR_PERSONAL_ACCESS_TOKEN }}
        file: target/release/mything
        asset_name: mything
        tag: ${{ github.ref }}
        overwrite: true
        body: "This is my release text"

Example for feeding a file from repo to the body tag:

This example covers following points:

  • Reading a file present on the repo. For example, release.md which is placed in root directory of the repo.
  • Modify & push the release.md file before triggering this action (create tag for this example) to dynamically change the body of the release.
name: Publish

on:
  push:
    tags:
      - '*'

jobs:

  build:
    name: Publish binaries
    runs-on: ubuntu-latest
         
    steps:
      - uses: actions/checkout@v3

      # This step reads a file from repo and use it for body of the release
      # This works on any self-hosted runner OS
      - name: Read release.md and use it as a body of new release
        id: read_release
        shell: bash
        run: |
          r=$(cat path/to/release.md)                       # <--- Read release.md (Provide correct path as per your repo)
          r="${r//'%'/'%25'}"                               # Multiline escape sequences for %
          r="${r//$'\n'/'%0A'}"                             # Multiline escape sequences for '\n'
          r="${r//$'\r'/'%0D'}"                             # Multiline escape sequences for '\r'
          echo "RELEASE_BODY=$r" >> $GITHUB_OUTPUT          # <--- Set environment variable

      - name: Upload Binaries to Release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          tag: ${{ github.ref }}
          body: |
            ${{ steps.read_release.outputs.RELEASE_BODY }}  # <--- Use environment variables that was created earlier

Permissions

This actions requires writes access to the release. If you are using granular permissions in your workflow, you will need to add the contents: write permission to the token:

permissions:
  contents: write

Releasing

To release this Action:

upload-release-action's People

Contributors

alexjurkiewicz avatar brandonkelly avatar dependabot[bot] avatar der-eismann avatar djpohly avatar edgarrmondragon avatar ggreif avatar leighmcculloch avatar loyalsoldier avatar messense avatar omaremaradev avatar pranjal-joshi avatar pzixel avatar regevbr avatar sandiz avatar shawaj avatar shonp40 avatar sonphantrung avatar spikatrix avatar svenstaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

upload-release-action's Issues

Allow attaching body

It might be helpful to automatically publish a body with a release (for changelogs or such).

Converting Pre-Release to Release

Hello,
I have a matrix job that builds executables for multiple platforms.

I want to upload binaries to the same pre-release and then publish the release only if all matrix jobs pass the test.

Need guidance for creating a pre-release first and then publishing the same in the next job if tests are passed.

Existing workflow is here - https://github.com/pranjal-joshi/Screeni-py/blob/c2899ab1097802ee2b7c91078a4c197c98377f79/.github/workflows/workflow-build-matrix.yml#L133

file_glob missing size according to GitHub API

Hi

Thanks for a great little application, trying to run the file_glob for the first time here and get the following issue which I presume is GitHub API's response:

Validation Failed: {"resource":"ReleaseAsset","code":"custom","field":"size","message":"size is not included in the list"}
image

Here's my steps

steps:
  - name: Upload assets
    uses: svenstaro/upload-release-action@v2
    with:
      repo_token: ${{ secrets.GITHUB_TOKEN }}
      file: build/*
      tag: ${{ github.ref }}
      overwrite: true
      file_glob: true

Allow using glob patterns to upload

Allow using glob patterns to upload.

e.g.

$(Build.ArtifactStagingDirectory)/**/*.nupkg;
!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg

PreRelease doesn't seem to work

Everything seems to work as it should, but when I check the release in GitHub it isn't marked as "pre-release". Everything else is set correctly. Am I missing something?

My workflow:

jobs:
  build:
    runs-on: windows-latest

    env:
      Pre_Release: ${{ contains(github.ref, 'dev') }}

    steps:
      - name: Upload binaries to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: MKVStudio.7z
          asset_name: MKVStudio.7z
          release_name: "${{ steps.gitversion.outputs.MajorMinorPatch }}"
          tag: "${{ steps.gitversion.outputs.MajorMinorPatch }}"
          overwrite: true
          body: |
            ${{ steps.Changelog.outputs.changelog }}
          prerelease: $env:Pre_Release

Result in the log:

with:
    repo_token: ***
    file: MKVStudio.7z
    asset_name: MKVStudio.7z
    release_name: 0.6.0
    tag: 0.6.0
    overwrite: true
    body: - no changes
    prerelease: $env:Pre_Release
  env:
    Pre_Release: true

Environment Variable in File Name

It could be more of a design question, but are environment variables supposed to be applied in the name field?

This was a snippet from my workflow:

    - name: Upload SH to release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ${{runner.workspace}}/EnergyPlus/build/${{ matrix.os }}_$PACKAGE_NAME_SH
        tag: ${{ github.ref }}
        overwrite: true

The double bracketed things were of course filled in when the file was processed by Github. The $PACKAGE_NAME_SH environment variable was set by using proper action commands dynamically just above this (echo ::set-env name=PACKAGE_NAME_SH::...). But when this action ran, the $PACKAGE_NAME_SH was left as-is, and of course, it couldn't find the package name which would have matched if that field had been replaced with the actual environment variable value.

Right now I can get it to work if I just file glob for the artifact name, but it zips the single file up, and I want the package uploaded in raw form. I'm trying to dynamically specify the exact filename and just need this environment variable to be populated with its value.

Thanks!

Uploading executable binary file

I am trying to upload an executable binary file to release but it is getting uploaded as a normal file and not as an executable. Any help on how to fix it? Or is it not possible to do?

Allow variable usage for tag

I want to provide a tag number via variable set in earlier steps; however it treats it as a string.

tag: $buildNumber

Glob fails as of 2.4.1

I noticed the glob package version was downgraded from "^8" to "^7" in release 2.4.1.
This seems to have led to an issue where the glob I'm using no longer works.
The syntax I'm using is:

C:/path/to/file1.txt,C:/path/to/file2.zip,C:/path/to/file3.yml

As of 2.4.1 (I'm tagging the action as @v2 in my workflow) it fails, saying the glob didn't match any files.
I triple checked and the logged file paths match existing files on my self-hosted CI machine (running Windows 10).

I don't mind pinning the version to 2.4.0, but I thought I'd let you know about what seems like a regression ๐Ÿ™‚

createRelease order race condition

There is a race (I just hit this) where createRelease fails because between trying to get it and create it, another build in the matrix already created it. A retry would help. Or maybe always createRelease and check if the failure indicates it already exists, and if so, try to fetch it then.

Specify architecture

Is it possible to specify an architecture, specifically I want to build for the Mac m1 (arm) ?
Thanks

Support for multiple files

Are multiple files supported? If not, is this feature planned in the future? Or should I just call the action multiple times?

how to overwrite body?

overwrite: true
The asset with the same name will be overwritten, but not the body.
body: latest build time XXXXXXXX

"Validation Failed" with overwrite: true

I have this upload-release-action stanza in my workflow:

    - name: publish repo
      id: publish
      if: steps.repo.outputs.rebuilt == 'true'
      uses: svenstaro/upload-release-action@v2
      with:
        tag: apt-get-test
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file_glob: true
        overwrite: true
        file: repo/*

but I'm consistently getting

Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"}

Modernise the `README.md`

Time is marching on, so

  • actions/checkout@v3
  • use >> "$GITHUB_OUTPUT" instead of set-output (which is deprecated) โ€” See #82
  • in presence of the above, newline conversion to %0A etc. is probably not necessary any more? See dfinity/motoko#3631

release_name does not seem to apply

Thank you for creating this very useful action!

Everything works as I'd like it to, except that it doesn't seem to pick up the release_name I've specified in the workflow file. The release name I get is the default tag name.

Here is my workflow file (See the last two jobs). I get v-dev as the name of the release instead of the specified one. Am I doing something wrong here?

Body - Read text from a file

Hello, Thanks for the great action!
Is there any way supported to get the body string from the file which is present in the repo?
So that this file can be changed for release description and committed to creat a new releases with dynamic bodies.

How to trigger the workflow

I have committed the workflow file but not sure about how to trigger the workflow. I have already created a tag and a release.

asset_name seems to be required

But the docs state it differently

Optional Arguments

asset_name: The name the file gets as an asset on a release. Use $tag to include the tag name. When not provided it will default to the filename. This is not used if file_glob is set to true.

Run svenstaro/upload-release-action@v1-release
  with:
    repo_token: ***
    file: target/project-linux-x86_64-gnu.tgz
    tag: latest
  env:
    project: project
##[error]Input required and not supplied: asset_name

Delete release and create new one?

Is it possible to delete an existing release (if one with the same name already exsits) and create a new one?
overwrite: true seems not do do this for me.

Can't get file_glob to work

Hi!

Thanks a lot for this action, it's very useful. I'm not sure if this is a bug or I'm doing something wrong.

Here's (part of) my workflow:

build-appimage-linux:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: Build AppImage
      run: ./packaging/linux/build_appimage.sh
    - name: Upload AppImage to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ./dist/*.AppImage
        file_glob: true
        overwrite: true
        tag: ${{ github.ref }}
build-windows-packages:
    runs-on: windows-2019
    steps:
    - uses: actions/checkout@v2
    - name: Build packages
      run: ./build.bat --package
    - name: Upload installer to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: dist\*.msi
        file_glob: true  
        overwrite: true
        tag: ${{ github.ref }}
    - name: Upload portable package to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: dist\*.zip
        file_glob: true  
        overwrite: true
        tag: ${{ github.ref }}

I have two jobs, one for Windows, the other for Linux. However file_glob doesn't work for either:

1s
Run svenstaro/upload-release-action@v2
  with:
    repo_token: ***
    file: ./dist/*.AppImage
    file_glob: true
    overwrite: true
    tag: refs/tags/vsdfkllsdkfgf_companion
Error: No files matching the glob pattern found.

Run svenstaro/upload-release-action@v2
  with:
    repo_token: ***
    file: dist\*.msi
    file_glob: true
    overwrite: true
    tag: refs/tags/vsdfkllsdkfgf_companion
Error: No files matching the glob pattern found.

The working directory is definitely set correctly (because the build script themselves can be found), and the dist directory definitely exists. What am I doing wrong?

My current workaround is to use full paths, which does work:

  build-appimage-linux:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: Build AppImage
      run: |
        source ./packaging/linux/build_appimage.sh
        echo "APPIMAGE_FULL_PATH=$_APPIMAGE_FILENAME" >> $GITHUB_ENV
    - name: Upload AppImage to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ${{ env.APPIMAGE_FULL_PATH }}
        overwrite: true
        tag: ${{ github.ref }}
 build-windows-packages:
    runs-on: windows-2019
    steps:
    - uses: actions/checkout@v2
    - name: Build packages
      run: |
        ./build.bat --package
        $WIN_INSTALLER_FULL_PATH = (Get-ChildItem -Path dist -Filter "*.msi").Fullname
        $WIN_PORTABLE_FULL_PATH = (Get-ChildItem -Path dist -Filter "*.zip").Fullname
        echo "WIN_INSTALLER_FULL_PATH=$WIN_INSTALLER_FULL_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
        echo "WIN_PORTABLE_FULL_PATH=$WIN_PORTABLE_FULL_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
    - name: Upload installer to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ${{ env.WIN_INSTALLER_FULL_PATH }}
        overwrite: true
        tag: ${{ github.ref }}
    - name: Upload portable package to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ${{ env.WIN_PORTABLE_FULL_PATH }}
        overwrite: true
        tag: ${{ github.ref }}

Can't find an example for using multiple files with different file paths

Is there an example for using multiple files with different paths and filenames?

example:

    - name: Upload binaries to release
      uses: svenstaro/upload-release-action@v1-release
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}

        file: .pio/build/esp32dev/firmware_esp32dev.bin
        asset_name: firmware_esp32dev.bin

        file: .pio/build/nodemcuv2/firmware_nodemcuv2.bin
        asset_name: firmware_nodemcuv2.bin

        tag: ${{ github.ref }}
        overwrite: true

Please retry read ECONNRESET

Here is my fail: https://github.com/abcfy2/qBittorrent-Enhanced-Edition/runs/4746010908?check_suite_focus=true

Run svenstaro/upload-release-action@v2
  with:
    repo_token: ***
    file: .github/workflows/qbittorrent-enhanced-nox_arm-linux-musleabi_static.zip
    tag: refs/tags/v4.4.0.11
    overwrite: true
/usr/bin/docker exec  9a91c2cc94ac097115ffd1249a0849d80ee97c1b5da000097cb9659eb9176bc1 sh -c "cat /etc/*release | grep ^ID"
Error: request to https://uploads.github.com/repos/abcfy2/qBittorrent-Enhanced-Edition/releases/56650008/assets?name=qbittorrent-enhanced-nox_arm-linux-musleabi_static.zip& failed, reason: read ECONNRESET

Release from artifact

Hello !
I try to release artifact from a python build but the actions doesn't release the good files.
My github action is :

name: Build

on:
  push:
    branches:
      - main

defaults:
  run:
    shell: bash
jobs:
  Build:
    name: Build release binaries

    strategy:
      fail-fast: false
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.10.0

      - name: Install Python dependencies Without MacOS
        if: matrix.os != 'macos-latest'
        run: |
          python -m pip install --upgrade pip pyinstaller
          pip install -r requirements.txt
      - name: Build windows
        if: matrix.os == 'windows-latest'
        run: pyinstaller Obsidian_Snippeter/GUI.py --name "${{matrix.os}}-Manager" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*;Obsidian_Snippeter/src/gui_bin/' --distpath app
      - name: Build Ubuntu
        if: matrix.os == 'ubuntu-latest'
        run: pyinstaller Obsidian_Snippeter/GUI.py --name "${{matrix.os}}-Manager" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*:Obsidian_Snippeter/src/gui_bin/' --distpath app
      - name: Build MacOS
        if: matrix.os == 'macos-latest'
        run: |
          brew install [email protected] && echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc && echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
          pip install pyinstaller
          pip install -r requirements.txt
          pyinstaller Obsidian_Snippeter/GUI.py --name "${{matrix.os}}-Manager" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*:Obsidian_Snippeter/src/gui_bin/' --distpath app
          
      - name: Deploy artifacts
        uses: actions/upload-artifact@v2
        with:
          name: app-${{ matrix.os }}
          path: app/${{ matrix.os }}-Manager
          if-no-files-found: error

      - name: Create release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: app/${{matrix.os}}-Manager
          asset_name: Obsidian_Snippet_Manager
          tag: ${{ github.ref }}
          body: "Release ${{ github.ref }}"

Anyone can help me ?

Grab asset name from the filename

I am receiving the error message below when not explicitly setting asset_name, which should use the filename.

##[error]Input required and not supplied: asset_name

Zipped file loses some memory

I set up an action to build and compile a mac application. It then zips this file and adds it to a release using this action. When I do these actions the exact same way on my computer manually it works fine but when the action is used and uploads the file it gives the following error message indicating that files and info is missing when run

Error:

/Users/Moosems/Downloads/DIP.app/Contents/MacOS/DIP ; exit;
Moosems-MBP:~ Moosems$ /Users/Moosems/Downloads/DIP.app/Contents/MacOS/DIP ; exit;
[6583] Error loading Python lib '/Users/Moosems/Downloads/DIP.app/Contents/MacOS/Python': dlopen: dlopen(/Users/moosems/Downloads/DIP.app/Contents/MacOS/Python, 10): Symbol not found: _preadv
  Referenced from: /Users/Moosems/Downloads/DIP.app/Contents/MacOS/Python (which was built for Mac OS X 11.0)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/Moosems/Downloads/DIP.app/Contents/MacOS/Python
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Action file:

name: Build and package Mac version

on:
  push:
    branches:
      main
  pull_request:
    branches: 
     main

jobs:
  build-app:
    runs-on: macos-latest

    steps:
    - uses: actions/checkout@v2

    - name: Install requirements
      run: pip3 install pyinstaller

    - name: Build
      run: pyinstaller DIP.spec
      
    - name: Log files
      run: |
        ls dist
        ls dist/DIP
        cd dist; zip -0 -r -y DIP.app.zip DIP.app

    - name: Upload binaries to release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.TOKEN }}
        file: dist/DIP.app.zip
        asset_name: DIP.app.zip
        tag: latest-mac-build
        overwrite: true

[BUG] All release tags are created on master

I want my dev branch to make prereleases but it still creates the release tags on master. This step should specify branch or commit while releasing.

target_commitish needs to be specified while making release. This can be an optional parameter, too.

Assertion `(ret) != (nullptr)' failed

Run svenstaro/upload-release-action@v[2](https://github.com/bluerobotics/BlueOS-docker/runs/5428302399?check_suite_focus=true#step:6:2)
  with:
    repo_token: ***
    file: BlueOS-raspberry.zip
    tag: refs/tags/1.0.0-beta.14
    overwrite: true
    prerelease: true

I'm getting:
/home/pi/actions-runner/externals/node12/bin/node[13726]: ../src/env-inl.h:949:char* node::Environment::Allocate(size_t): Assertion `(ret) != (nullptr)' failed.

The file is around 1GB.

specify release name

Currently the asset name is specified with asset_name, but the actual release itself doesn't get a name & body (description). The GH web view does display a title & description based on the first line & rest of the commit message respectively, but the API returns null

This is ok (once you know how it works) but it'd be nice if there was a release_name (and even optional release_argument options for this action to set those as well. Is that a possibility? Or does the octokit lib not make that easy?

Upload multiple files on release event

Is there any possible way to upload multiple files on a release event? I know I can do it with multiple jobs. But anyway to do it within a single job?

*Prevent* release creation?

tl;dr: is there a technique for preventing the creation of a release if it doesn't already exist? I'd rather have it fail.

Longer version:

I'm actually using workflow_dispatch with a user-supplied ref to run my action, because it can produce useful artifacts for any ref the user supplies, for example, an issue-specific debug branch, older versions, etc.

On the other hand, if the user-supplied ref is a tag that's associated with a release is provided, it would be awesome to upload the artifacts to the release automatically, but I don't want to create releases if they don't already exists.

Is there any solution to this that exists, even if it requires previous steps? Alternatively, if I were to supply a PR with a new attribute governing creating (or not) a new release, are you open to that?

Thanks!

Can not release ".app" files on macos

I am trying to deploy assets for linux, windows and mac following the README example. However the action terminates with different error messages when releasing the mac asset:

  1. Error: request to https://uploads.github.com/repos/FlamingTuri/test/releases/48849361/assets?name=main-macos.app& failed, reason: write EPIPE

    {"message":"Bad Content-Length: ","request_id":"BB46:0F6B:249001:2D594B:612FF778"}
    
  2. Error: Validation Failed: {"resource":"ReleaseAsset","code":"custom","field":"name","message":"name has a file extension that is not allowed"}

  3. Error: request to https://uploads.github.com/repos/FlamingTuri/test/releases/48841901/assets?name=main-macos.app& failed, reason: socket hang up
    Which once again leads to a

    {"message":"Bad Content-Length: ","request_id":"ECBC:37A3:D1831F:E886C4:612FFC47"}
    

This is my yaml workflow:

name: release-artifacts

on: release

jobs:
  release:
    name: Release for ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            artifactName: main-linux
          - os: windows-latest
            artifactName: main-windows.exe
          - os: macos-latest
            artifactName: main-macos.app
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v2
        with:
          node-version: 'lts/*'
      - uses: actions/setup-python@v2
        with:
          python-version: '3.x'
      - run: node .github/script/create-asset.mjs ${{ matrix.artifactName }}
      - uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: server/dist/${{ matrix.artifactName }}
          asset_name: ${{ matrix.artifactName }}
          tag: ${{ github.ref }}
          overwrite: true

Moreover, everything works smoothely if I delete the ".app" extension.

Since some errors are due to content length, could they be caused by bug in the node runtime used by the action? I had other issues with node 12 (mainly involving speed) on mac actions.

[feature-request] Create a GH release in a foreign repository

I would like to use this action to create a GH release in a foreign repository. I have access to the foreign repository. I do not know if it's possible to achieve it with GH Actions in general, but I thought it worth a feature request.

Use case:

  • There is a private GH repo that hosts the source code. GH Actions workflows are configured in the private repository.
  • There is a public repository where the users can log issues and can download the releases. They do not (yet) see the source code.

Current workflow:

  • GH Actions is used to create the GH releases in the private repository.
  • The corresponding GH release has to be created manually in the public repo and the artifacts have to be upload.

I would like to create a GH release in the public repo from a workflow triggered by the private repository.

For example, the GitHub Release task can do this on Azure. Would it be possible to achieve something with this action? There is a repositoryName property, that defaults to the current repo.

The config would be something like this:

  - name: Publish Release [GitHub]
    uses: svenstaro/upload-release-action@v1-release
    with:
      repo_token: ${{ secrets.GITHUB_TOKEN }}
      repository_name: owner/foreign-repository-name
      file: dist/*
      tag: ${{ github.ref }}
      file_glob: true

Thank you for this great action!

@1.0.1 / error / file_glob invalid

Unexpected input 'file_glob', valid inputs are ['repo_token', 'file', 'asset_name', 'tag', 'overwrite']
Input required and not supplied: asset_name

    - name: Upload files to a GitHub release
      uses: svenstaro/[email protected]
      if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'ref/head/master')
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: obj/*.hex
        #asset_name: ignored
        tag: ${{ github.ref }}
        overwrite: false
        file_glob: true
```

it works with @v1

However, i need a "Draft", my testing of this went to a live release :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.