generated from konveyor-ecosystem/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👻 Add workflow to upload binaries to releases (#182)
* 👻 add workflow to upload binaries to releases Signed-off-by: Pranav Gaikwad <[email protected]> * 👻 wait for image to publish Signed-off-by: Pranav Gaikwad <[email protected]> * 👻 use manual trigger Signed-off-by: Pranav Gaikwad <[email protected]> --------- Signed-off-by: Pranav Gaikwad <[email protected]>
- Loading branch information
1 parent
8c6ee6f
commit 6a5750a
Showing
2 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters