generated from konveyor-ecosystem/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 27
69 lines (62 loc) · 2.44 KB
/
release-artifacts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 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