Git Product home page Git Product logo

archive-action's Introduction

archive

Creates ZIP and TAR archives on Linux, Windows and macOS.

Usage

See action.yml

Create an archive including the whole working directory

uses: ksm2/archive-action@v1
with:
  format: "tar.gz"
  name: my-bundle

Create an archive using specific files

uses: ksm2/archive-action@v1
with:
  format: "tar.gz"
  name: my-bundle
  include: "**/*.(ts|js|css|html)"

Create an archive from a specific root directory

uses: ksm2/archive-action@v1
with:
  root-directory: dist
  format: "tar.gz"
  name: my-bundle
  include: "*.(ts|js|css|html)"

Create multiple archives using a Matrix Strategy

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        archive: [ "zip", "tar" ]
    steps:
      - uses: actions/checkout@v3
      - uses: ksm2/archive-action@v1
        with:
          format: ${{ matrix.archive }}
          name: my-bundle
          include: "**/*.(ts|js|css|html)"

Upload an archive as a release artifact

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    
    steps:
      - uses: actions/checkout@v3

      - uses: actions/create-release@v1
        id: create_release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: "v1.0.0"
          release_name: "My Release"
          draft: true
          prerelease: false

      - uses: ksm2/archive-action@v1
        id: archive
        with:
          format: "zip"
          name: my-bundle
          include: "**/*.(ts|js|css|html)"

      - uses: actions/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ${{ steps.archive.outputs.path }}
          asset_name: ${{ steps.archive.outputs.name }}
          asset_content_type: ${{ steps.archive.outputs.media-type }}

Inputs

format

Required The archive format to use. Default "zip".

Available Options:

  • "zip"
  • "tar"
  • "tar.gz"

name

Required The name of the archive to produce.

The file ending for the archive will be attached.

root-directory

The directory to package files from. Default is the working directory.

include

An optional glob pattern to only include specific files. Uses Minimatch for applying the pattern. Default is to include all files found in the directory.

Outputs

name

The basename of the produced archive, e.g. "my-bundle.tar.gz".

path

The absolute path of the produced archive, e.g. "/path/to/my-bundle.tar.gz".

media-type

The media type of the produced archive, e.g. "application/zip".

archive-action's People

Contributors

ksm2 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.