Skip to content
archive

GitHub Action

Release Files Action

v1.1.3 Latest version

Release Files Action

archive

Release Files Action

Upload or download assets from given github release

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Release Files Action

uses: mkatanski/release-files-action@v1.1.3

Learn more about this action in mkatanski/release-files-action

Choose a version

Release Files Action

GitHub Action for uploading or downloading assets to or from existing release.

Inputs

  token:
    description: 'GitHub token'
    type: string
    required: true

  release-tag:
    description: 'Tag releated to release'
    type: string
    required: true

  file-path:
    description: 'File path to upload or download'
    type: string
    required: true

  name:
    description: 'Asset name (default to file-path name). In download mode must be the name of release asset.'
    type: string
    required: false

  label:
    description: 'Asset label'
    type: string
    required: false

  content-type:
    description: 'File content type'
    type: string
    default: 'application/zip'
    required: false

  mode:
    description: 'Choose to download or upload asset'
    type: string
    default: upload
    required: false

Example usage

jobs:
  upload-release-assets:
    runs-on: ubuntu-latest
    name: Upload release assets
    steps:
      - uses: actions/checkout@v4

      - name: Create artifact from dist folder
        run: zip -r release-files-dist-${{ github.ref_name }}.zip dist

      - name: Upload created artifact to release assets
        id: upload-assets
        uses: mkatanski/release-files-action@v1.0.1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          release-tag: ${{ github.ref_name }}
          file-path: release-files-dist-${{ github.ref_name }}.zip

  download-release-assets:
    runs-on: ubuntu-latest
    name: Download release assets
    needs: upload-release-assets
    steps:
      - uses: actions/checkout@v4

      - name: Download release assets
        id: download-assets
        uses: mkatanski/release-files-action@v1.0.1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          release-tag: ${{ github.ref_name }}
          file-path: downloaded-${{ github.ref_name }}.zip
          name: release-files-dist-${{ github.ref_name }}.zip
          mode: download