Creates ZIP and TAR archives on Linux, Windows and macOS.
See action.yml
uses: ksm2/archive-action@v1
with:
format: "tar.gz"
name: my-bundle
uses: ksm2/archive-action@v1
with:
format: "tar.gz"
name: my-bundle
include: "**/*.(ts|js|css|html)"
uses: ksm2/archive-action@v1
with:
root-directory: dist
format: "tar.gz"
name: my-bundle
include: "*.(ts|js|css|html)"
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)"
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/upload-release-asset@v1.0.1
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 }}
Required The archive format to use. Default "zip"
.
Available Options:
"zip"
"tar"
"tar.gz"
Required The name of the archive to produce.
The file ending for the archive will be attached.
The directory to package files from. Default is the working directory.
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.
The basename of the produced archive, e.g. "my-bundle.tar.gz"
.
The absolute path of the produced archive, e.g. "/path/to/my-bundle.tar.gz"
.
The media type of the produced archive, e.g. "application/zip"
.