ci: Add artifact upload for baked images.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
25
.github/workflows/bake.yml
vendored
25
.github/workflows/bake.yml
vendored
@@ -101,6 +101,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
# Call docker
|
||||||
- name: Bake ${{matrix.bake_target}}
|
- name: Bake ${{matrix.bake_target}}
|
||||||
env:
|
env:
|
||||||
bake_target: ${{matrix.bake_target}}
|
bake_target: ${{matrix.bake_target}}
|
||||||
@@ -121,8 +122,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker/bake.sh "${{matrix.bake_target}}"
|
docker/bake.sh "${{matrix.bake_target}}"
|
||||||
|
|
||||||
- if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
# Optionally extract an inner artifact
|
||||||
name: Extract Artifact
|
- name: Extract Artifact
|
||||||
|
if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst && fromJSON(inputs.artifact)[matrix.bake_target].img == null }}
|
||||||
env:
|
env:
|
||||||
iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
|
iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
|
||||||
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
||||||
@@ -131,11 +133,24 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cid=$(docker create "$iid" /)
|
cid=$(docker create "$iid" /)
|
||||||
rm -rf _artifact
|
rm -rf _artifact
|
||||||
mkdir -p _artifact/$dst/
|
mkdir -p "_artifact/$dst"
|
||||||
docker cp "$cid:$src" "_artifact/$dst/$dst"
|
docker cp "$cid:$src" "_artifact/$dst/$dst"
|
||||||
|
|
||||||
- if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
# Optionally extract the image itself as an artifact.
|
||||||
name: Upload Artifact
|
- name: Extract Image
|
||||||
|
if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst && fromJSON(inputs.artifact)[matrix.bake_target].img != null }}
|
||||||
|
env:
|
||||||
|
iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
|
||||||
|
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
||||||
|
|
||||||
|
run: |
|
||||||
|
rm -rf _artifact
|
||||||
|
mkdir -p "_artifact/$dst"
|
||||||
|
docker save -o "_artifact/$dst/$dst" "$iid"
|
||||||
|
|
||||||
|
# Upload either artifact
|
||||||
|
- name: Upload Artifact
|
||||||
|
if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: _artifact/${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
path: _artifact/${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
|
||||||
|
|||||||
5
.github/workflows/package.yml
vendored
5
.github/workflows/package.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
|||||||
name: Standalone
|
name: Standalone
|
||||||
uses: ./.github/workflows/bake.yml
|
uses: ./.github/workflows/bake.yml
|
||||||
with:
|
with:
|
||||||
bake_targets: '["standalone"]'
|
bake_targets: '["standalone", "tuwunel"]'
|
||||||
cargo_profiles: ${{inputs.cargo_profiles}}
|
cargo_profiles: ${{inputs.cargo_profiles}}
|
||||||
feat_sets: ${{inputs.feat_sets}}
|
feat_sets: ${{inputs.feat_sets}}
|
||||||
rust_toolchains: ${{inputs.rust_toolchains}}
|
rust_toolchains: ${{inputs.rust_toolchains}}
|
||||||
@@ -58,7 +58,8 @@ jobs:
|
|||||||
includes: ${{inputs.includes}}
|
includes: ${{inputs.includes}}
|
||||||
artifact: >
|
artifact: >
|
||||||
{
|
{
|
||||||
"standalone": {"dst": "tuwunel"}
|
"standalone": {"dst": "tuwunel"},
|
||||||
|
"tuwunel": {"dst": "tuwunel-docker.tar.gz", "img": true }
|
||||||
}
|
}
|
||||||
|
|
||||||
build_pkgs:
|
build_pkgs:
|
||||||
|
|||||||
Reference in New Issue
Block a user