Skip to content

Commit f13b579

Browse files
committed
gha: Release a vendor tarball for distributions to do offline builds
Distributions need to be able to build offline using static sources. I didn't bother including the tarball in development releases to save space. The vendoring is done just before the actual build so that the build can reuse these files, avoiding the need to download them again for each platform. Signed-off-by: James Le Cuirot <[email protected]>
1 parent a7cec4e commit f13b579

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,17 @@ jobs:
5252
fi
5353
echo "RELEASE_VERSION=${RELEASE_VERSION}"
5454
RELEASE_NUM="$(date +%Y%m%d%H%M%S).$(git rev-parse --short HEAD)"
55+
docker run --rm -v "${PWD}":/src --workdir /src "golang:${{ env.GO_VERSION }}" sh -c "go mod vendor -o /tmp/vendor && tar -C /tmp -c vendor/" | tar -x
5556
docker buildx build --build-arg RELEASE_NUM=${RELEASE_NUM} --build-arg RELEASE_VERSION=${RELEASE_VERSION} --build-arg GO_VERSION=${{ env.GO_VERSION }} -f .github/workflows/release/Dockerfile --platform=linux/amd64,linux/arm64 -o releases/ .
56-
ls -l releases/*/
57+
XZ_OPT="-T0 -9" tar --create --auto-compress --file "releases/accelerated-container-image-${GITHUB_REF_NAME#v}-vendor.tar.xz" --transform="s:^:accelerated-container-image-${GITHUB_REF_NAME#v}/:" --owner=root --group=root vendor/
58+
ls -l releases/*
5759
- name: Upload
5860
uses: actions/upload-artifact@v5
5961
with:
6062
name: releases
61-
path: releases/*/overlaybd-snapshotter*
63+
path: |
64+
releases/*/overlaybd-snapshotter*
65+
releases/accelerated-container-image-*-vendor.tar.xz
6266
6367
dev-release:
6468
name: Development Release
@@ -70,7 +74,7 @@ jobs:
7074
uses: actions/download-artifact@v6
7175
- name: Display downloaded files
7276
shell: bash
73-
run: ls -l releases/*/
77+
run: ls -l releases/*
7478
- name: Create Release
7579
uses: "marvinpinto/action-automatic-releases@latest"
7680
with:
@@ -91,11 +95,12 @@ jobs:
9195
uses: actions/download-artifact@v6
9296
- name: Display downloaded files
9397
shell: bash
94-
run: ls -l releases/*/
98+
run: ls -l releases/*
9599
- name: Create Release
96100
uses: "marvinpinto/action-automatic-releases@latest"
97101
with:
98102
repo_token: "${{ secrets.GITHUB_TOKEN }}"
99103
prerelease: false
100104
files: |
101105
releases/*/overlaybd-snapshotter*
106+
releases/accelerated-container-image-*-vendor.tar.xz

0 commit comments

Comments
 (0)