Skip to content

Commit 54478b3

Browse files
yash-zededaeriknordmark
authored andcommitted
to trigger assets from publish only for tah builds
Signed-off-by: yash-zededa <[email protected]>
1 parent b3a064f commit 54478b3

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

.github/workflows/assets.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,11 @@
1313
---
1414
name: Assets
1515
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
2621

2722
jobs:
2823
build:
@@ -35,15 +30,15 @@ jobs:
3530
- name: checkout repo
3631
uses: actions/checkout@v3
3732
with:
38-
ref: ${{ github.event.workflow_run.head_branch }}
33+
ref: ${{ inputs.tag_ref }}
3934
fetch-depth: 0
4035
- name: Force fetch annotated tags (workaround)
4136
# Workaround for https://github.com/actions/checkout/issues/290
4237
run: |
4338
git fetch --force --tags
4439
- name: Determine architecture prefix and ref
4540
env:
46-
REF: ${{ github.event.workflow_run.head_branch }}
41+
REF: ${{ inputs.tag_ref }}
4742
run: |
4843
# FIXME: I'd rather be a real matrix job with a functional arm64 runner
4944
# echo "ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')" >> "$GITHUB_ENV"
@@ -60,7 +55,7 @@ jobs:
6055
run: |
6156
HV=kvm
6257
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 }}
6459
docker pull "$EVE"
6560
else
6661
make pkgs
@@ -71,7 +66,7 @@ jobs:
7166
docker run "$EVE" installer_net | tar -C assets -xvf -
7267
- name: Create direct iPXE config
7368
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 }}."
7570
sed -i. -e '/# set url https:/s#^.*$#set url '"$URL"'#' assets/ipxe.efi.cfg
7671
for comp in initrd rootfs installer; do
7772
sed -i. -e "s#initrd=${comp}#initrd=${{ env.ARCH }}.${comp}#g" assets/ipxe.efi.cfg
@@ -89,7 +84,7 @@ jobs:
8984
- name: Pull eve-sources and publish collected_sources.tar.gz to assets
9085
run: |
9186
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 }}
9388
docker pull "$EVE_SOURCES"
9489
docker create --name eve_sources "$EVE_SOURCES" bash
9590
docker export --output assets/collected_sources.tar.gz eve_sources
@@ -101,7 +96,7 @@ jobs:
10196
result-encoding: string
10297
script: |
10398
console.log(context)
104-
tag = '${{ env.TAG }}'
99+
tag = '${{ inputs.tag_ref }}'
105100
106101
// first create a release -- it is OK if that fails,
107102
// since it means the release is already there

.github/workflows/publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,10 @@ jobs:
154154
command: "V=1 LINUXKIT_PKG_TARGET=manifest pkgs"
155155
dockerhub-token: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
156156
dockerhub-account: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }}
157+
158+
trigger_assets:
159+
if: ${{ (startsWith(github.ref, 'refs/tags/')) && (github.event.repository.full_name == 'lf-edge/eve') }}
160+
needs: packages
161+
uses: lf-edge/eve/.github/workflows/assets.yml@master
162+
with:
163+
tag_ref: ${{ github.ref }}

0 commit comments

Comments
 (0)