Skip to content
archive

GitHub Action

Zip Release

0.7.6 Latest version

Zip Release

archive

Zip Release

Make an archive from specified files and directories as workflow action

Installation

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

              

- name: Zip Release

uses: TheDoctor0/[email protected]

Learn more about this action in TheDoctor0/zip-release

Choose a version

Zip Release License

GitHub action that can be used to create release archive using zip or tar.

It works on all platforms: Linux, MacOS and Windows.

Usage

An example workflow config:

name: Create Archive
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Archive Release
      uses: thedoctor0/[email protected]
      with:
        type: 'zip'
        filename: 'release.zip'
        exclusions: '*.git* /*node_modules/* .editorconfig'

The generated archive will be placed as specified by directory, path and filename. If you want to attach it to the latest release use another action like ncipollo/release-action:

- name: Upload Release
  uses: ncipollo/[email protected]
  with:
    artifacts: "release.zip"
    token: ${{ secrets.GITHUB_TOKEN }}

Arguments

filename

Default: release.zip

The filename for the generated archive, relative to directory.

If you use type: tar it's recommended to set the filename to a tar.gz (the tarball is always gzip compressed).

directory

Default: .

The working directory where the zip or tar actually runs.

path

Default: .

The path to the files or directory that should be archived, relative to directory.

Path with whitespace is currently not supported because of the limitation of GitHub actions regarding the parameter formatting (no YAML double quoting). A solution based on similar issues will soon be implemented.

type

Default: zip

Either zip or tar or 7z.

Defines if either a ZIP-file is created, or a tar archive (the latter gzipped).

On Windows platform 7zip is used to zip files as zip command is unavailable there.

exclusions

Default: none

List of excluded files or directories.

Please note: this handles slightly differently, depending on if you use type: zip or type: tar.

ZIP requires you to specify wildcards or full filenames.

TAR allows you to specify only the filename, no matter if it's in a subdirectory.

recursive_exclusions

Default: none

Alternative to exclusions that allows you to specify a list of recursive wildcards. Only applies to type: zip on Windows where 7zip is used.

For example:

exclusions: *.txt will only exclude files ending with .txt

recursive_exclusions: *.txt will exclude files ending with .txt in any subdirectory.

custom

Default: none

Provide any custom parameters to the zipping command.

For example:

custom: --ignore-failed-read option used with tar command, which allows to ignore and continue on unreadable files.

command

Default: none

An extra command that will run before zipping.

For example:

command: "mkdir -p release" can be used to create a directory where the archived file can be stored to fix tar issue with file changed as we read it error