Giter VIP home page Giter VIP logo

github-upload-release-artifacts-action's Introduction

GitHub Action for Uploading Release Artifacts

This action will upload all paths passed as arguments as artifacts to an existing release. This action should be triggered with a tag after a release for this tag has been created.

Arguments can either be file or directory paths, for directories all contained files will be uploaded.

Usage

A sample workflow would be:

on: push
name: Build & Release
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: build
      run: |
        ./build.sh
  release:
    runs-on: ubuntu-latest
    needs: [build]
    steps:
    - uses: actions/checkout@master
    - name: Create release
      uses: Roang-zero1/github-create-release-action@v2
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - name: Upload release artifacts
      uses: Roang-zero1/github-upload-release-artifacts-action@v2
      with:
        args: "dist/bin/ dist/shell/compiled.sh"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Secrets

  • GITHUB_TOKEN Provided by the GitHub action

Acknowledgments

Idea based on fnkr/github-action-ghr

github-upload-release-artifacts-action's People

Contributors

alatyami avatar rasaha91 avatar roang-zero1 avatar

Stargazers

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

Watchers

 avatar  avatar

github-upload-release-artifacts-action's Issues

Wildcard support in args would be nice

Being able to specify wildcards would be really useful

        - name: Upload the ubuntu release artifacts
          if: startsWith(github.ref, 'refs/tags/')
          uses: Roang-zero1/github-upload-release-artifacts-action@v1
          with:
            args: vengi*.deb

but doing so produces:

Error: Invalid path passed: vengi*.deb

This is not a tagged push after github-create-release-action with created_tag

I get an error when using github-create-release-action with created_tag

name: CI
on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
  workflow_dispatch:


jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Build debian package
        run: ./create-deb.sh

      - name: Get version
        run: |
          version=$(ls azure-storage-explorer_*_x64.deb | grep -Po '(?<=azure-storage-explorer_)[^\_]+')
          echo "version=$version" >> $GITHUB_ENV

      - name: Create tag
        uses: actions/github-script@v5
        with:
          script: |
            github.rest.git.createRef({
              owner: context.repo.owner,
              repo: context.repo.repo,
              ref: 'refs/tags/v${{ env.version }}',
              sha: context.sha
            })
          
      - name: Create release
        uses: Roang-zero1/github-create-release-action@v3
        with:
          created_tag: 'v${{ env.version }}'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Upload release artifacts
        uses: Roang-zero1/github-upload-release-artifacts-action@v2
        with:
          args: "azure-storage-explorer_${{ env.version }}_x64.deb"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Run Roang-zero1/github-upload-release-artifacts-action@v2
/usr/bin/docker run --name c044253b6ea2b480[7](https://github.com/kitingChris/azure-storage-explorer-deb-package/actions/runs/4450203117/jobs/7815362068#step:9:8)453d94b1[8](https://github.com/kitingChris/azure-storage-explorer-deb-package/actions/runs/4450203117/jobs/7815362068#step:9:9)35f47b1a63a_8c7e5a --label 6c0442 --workdir /github/workspace --rm -e "version" -e "GITHUB_TOKEN" -e "INPUT_ARGS" -e "INPUT_CREATED_TAG" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/azure-storage-explorer-deb-package/azure-storage-explorer-deb-package":"/github/workspace" 6c0442:53b6ea2b4807453d94b1835f47b1a63a azure-storage-explorer_1.1.1_x64.deb
This is not a tagged push.

Support for glob patterns

First of all, thanks so much fo this great project as it has made it so easy to use GitHub actions for uploading files to GitHub releases!

One thing that would be super helpful would be to have support for file glob patterns. The reason this is important for me is because I'm using this extension to upload VS Code extension files which are placed in the root directory of the project when built and they contain a version number in them thus making a hard coded approach difficult. Unfortunately, the VS Code extension cli doesn't have an easy way to place the file in a subdirectory while maintaining the version number automatically. My solution currently looks like this.

    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-node@v1
        with:
          node-version: 10
      - run: yarn
      - run: |
          mkdir dist
          yarn vsce package -o dist/one-dark-theme-${GITHUB_REF/refs\/tags\//}.vsix
      - uses: Roang-zero1/github-upload-release-artifacts-action@master
        with:
          args: dist
        env:
          GITHUB_TOKEN: ${{ secrets.github_auth_token }}

By adding glob patterns I could do it like this.

    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-node@v1
        with:
          node-version: 10
      - run: yarn
      - run: yarn vsce package
      - uses: Roang-zero1/github-upload-release-artifacts-action@master
        with:
          args: '*.vsix'
        env:
          GITHUB_TOKEN: ${{ secrets.github_auth_token }}

The workflow is not valid: Unexpected value 'args'" args.

Hello.
I have tried to use your action, but GitHub says the workflow is not valid: "The workflow is not valid. .github/workflows/publish-plugin.yml (Line: 29, Col: 9): Unexpected value 'args'" args.

Here is my example:

      - name: Push Artifact to release
        uses: Roang-zero1/github-upload-release-artifacts-action@master
        with:
          created_tag: ${{ github.ref }}
          args:
             - build/distributions
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I have checked the source and "args" are indeed not defined as an input for the plugin.

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.