Skip to content

Upload binaries to release assets #1

Upload binaries to release assets

Upload binaries to release assets #1

# this workflow makes sure we upload kantra binaries to release assets
name: "Upload binaries to release assets"
on:
workflow_dispatch:
inputs:
use_latest_release:
type: boolean
default: true
description: Upload binaries to the most recent release
tag_pattern:
type: string
default: 'v*'
description: Pick from tags matching this pattern
jobs:
resolve-and-upload:
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch: ["amd64", "arm64"]
os: ["ubuntu-latest"]
steps:
- id: release_info
uses: joutvhu/get-release@v1
with:
latest: ${{ github.event.inputs.use_latest_release }}
tag_pattern: ${{ github.event.inputs.tag_pattern }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract binaries
run: |
image=quay.io/konveyor/kantra:${{ steps.release_info.outputs.tag_name }}
podman create --name kantra-download ${image}
podman cp kantra-download:/usr/local/bin/kantra . && zip kantra.linux.${{ matrix.arch }}.zip kantra
podman cp kantra-download:/usr/local/bin/darwin-kantra . && zip kantra.darwin.${{ matrix.arch }}.zip darwin-kantra
podman cp kantra-download:/usr/local/bin/windows-kantra windows-kantra.exe && zip kantra.windows.${{ matrix.arch }}.zip windows-kantra.exe
- name: Upload linux binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_info.outputs.upload_url }}
asset_path: ./kantra.linux.${{ matrix.arch }}.zip
asset_name: kantra.linux.${{ matrix.arch }}.zip
asset_content_type: application/zip
- name: Upload windows binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_info.outputs.upload_url }}
asset_path: ./kantra.windows.${{ matrix.arch }}.zip
asset_name: kantra.windows.${{ matrix.arch }}.zip
asset_content_type: application/zip
- name: Upload darwin binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_info.outputs.upload_url }}
asset_path: ./kantra.darwin.${{ matrix.arch }}.zip
asset_name: kantra.darwin.${{ matrix.arch }}.zip
asset_content_type: application/zip