capact icon indicating copy to clipboard operation
capact copied to clipboard

Create Capact images tarball and put in release assets

Open mszostok opened this issue 4 years ago • 2 comments

Description

Add a step to our Capact release which will create an archive and upload it as GitHub release artefact.

Script which does the release: https://github.com/capactio/capact/blob/main/hack/make-release.sh

AC

  1. Create archive (compressed, as GitHub allows only up to 2 GB per asset)

    capact alpha archive-images helm -v --version ${CAPACT_VERSION} -o ./capact-images-amd64.tar.gz --compress gzip
    
  2. Put the archive in release assets:

    1. Use gh cli: gh release upload (source: https://cli.github.com/manual/gh_release_upload)
    2. or use GitHub action, e.g. https://github.com/AButler/upload-release-assets

Reason

Currently, user needs to execute that manually, and it takes time to create such archive. The images in a given release are "hardcoded" we can prepare such archive upfront.

mszostok avatar Sep 17 '21 09:09 mszostok

@mszostok @pkosiec I would like to give this issue a shot. Please let me know how to onboard myself with it & I can start.

amoghrajesh avatar Oct 01 '21 05:10 amoghrajesh

Hi @amoghrajesh sorry for such late response. Unfortunately, we were on holidays.

As CI system we use GitHub Action. For release definition is in .github/workflows/make-release.yaml file.

After make release binaries step, you can add a new step:

      - name: Download Capact CLI for linux
        run: |
          curl -Lo ./capact https://storage.googleapis.com/capactio-binaries/latest/capact-linux-amd64
          chmod +x ./capact

Next you need to use CLI to archive images from a given release:

      - name: Create images archive
        run: |
          ./capact alpha archive-images helm -v --version  "${{ github.event.inputs.version }}" -o ./capact-images-amd64.tar.gz --compress gzip

More info about archive command: https://capact.io/docs/cli/commands/capact_alpha_archive-images_helm

and upload artifact via gh or with GH action:

    steps:
      - uses: AButler/[email protected]
        with:
          files: './capact-images-amd64.tar.gz'
          repo-token: ${{ secrets.GITHUB_TOKEN }}
     # or ...
      - name: Upload images archive to GitHub release
        run: |
          gh release upload "v${{ github.event.inputs.version }}" ./capact-images-amd64.tar.gz

it's not tested. I just create code snippets based on docs. It needs to be tested on your fork :)

If you will need any help, join our Slack channel :) https://capact.io/community/slack

mszostok avatar Oct 12 '21 11:10 mszostok