13
13
---
14
14
name : Assets
15
15
on : # yamllint disable-line rule:truthy
16
- workflow_run :
17
- workflows :
18
- - Publish
19
- types :
20
- - completed
21
- branches :
22
- - " master"
23
- - " [0-9]+.[0-9]+"
24
- - " [0-9]+.[0-9]+-stable"
25
- - " [0-9]+.[0-9]+-lts"
16
+ workflow_call :
17
+ inputs :
18
+ tag_ref :
19
+ required : true
20
+ type : string
26
21
27
22
jobs :
28
23
build :
@@ -35,15 +30,15 @@ jobs:
35
30
- name : checkout repo
36
31
uses : actions/checkout@v3
37
32
with :
38
- ref : ${{ github.event.workflow_run.head_branch }}
33
+ ref : ${{ inputs.tag_ref }}
39
34
fetch-depth : 0
40
35
- name : Force fetch annotated tags (workaround)
41
36
# Workaround for https://github.com/actions/checkout/issues/290
42
37
run : |
43
38
git fetch --force --tags
44
39
- name : Determine architecture prefix and ref
45
40
env :
46
- REF : ${{ github.event.workflow_run.head_branch }}
41
+ REF : ${{ inputs.tag_ref }}
47
42
run : |
48
43
# FIXME: I'd rather be a real matrix job with a functional arm64 runner
49
44
# echo "ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')" >> "$GITHUB_ENV"
60
55
run : |
61
56
HV=kvm
62
57
if [ "${{ github.event.repository.full_name }}" = "lf-edge/eve" ]; then
63
- EVE=lfedge/eve:${{ env.TAG }}-${HV}-${{ env.ARCH }}
58
+ EVE=lfedge/eve:${{ inputs.tag_ref }}-${HV}-${{ inputs.tag_ref }}
64
59
docker pull "$EVE"
65
60
else
66
61
make pkgs
71
66
docker run "$EVE" installer_net | tar -C assets -xvf -
72
67
- name : Create direct iPXE config
73
68
run : |
74
- URL="${{ github.event.repository.html_url }}/releases/download/${{ env.TAG }}/${{ env.ARCH }}."
69
+ URL="${{ github.event.repository.html_url }}/releases/download/${{ inputs.tag_ref }}/${{ env.ARCH }}."
75
70
sed -i. -e '/# set url https:/s#^.*$#set url '"$URL"'#' assets/ipxe.efi.cfg
76
71
for comp in initrd rootfs installer; do
77
72
sed -i. -e "s#initrd=${comp}#initrd=${{ env.ARCH }}.${comp}#g" assets/ipxe.efi.cfg
89
84
- name : Pull eve-sources and publish collected_sources.tar.gz to assets
90
85
run : |
91
86
HV=kvm
92
- EVE_SOURCES=lfedge/eve-sources:${{ env.TAG }}-${HV}-${{ env.ARCH }}
87
+ EVE_SOURCES=lfedge/eve-sources:${{ inputs.tag_ref }}-${HV}-${{ env.ARCH }}
93
88
docker pull "$EVE_SOURCES"
94
89
docker create --name eve_sources "$EVE_SOURCES" bash
95
90
docker export --output assets/collected_sources.tar.gz eve_sources
101
96
result-encoding : string
102
97
script : |
103
98
console.log(context)
104
- tag = '${{ env.TAG }}'
99
+ tag = '${{ inputs.tag_ref }}'
105
100
106
101
// first create a release -- it is OK if that fails,
107
102
// since it means the release is already there
0 commit comments