Skip to content

Commit

Permalink
fix(ci): uniquely identify rocks from parallel builds (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdcordeiro authored Mar 14, 2024
1 parent 7727a98 commit 2d90ca7
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/Build-Rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ jobs:
- name: Rename ROCK OCI archive
id: rock
run: |
mkdir ${{ env.ROCKS_CI_FOLDER }}
cp ${{ steps.rockcraft.outputs.rock }} ${{ env.ROCKS_CI_FOLDER }}/$(basename ${{ steps.rockcraft.outputs.rock }})
# mkdir ${{ env.ROCKS_CI_FOLDER }}
# cp ${{ steps.rockcraft.outputs.rock }} ${{ env.ROCKS_CI_FOLDER }}/$(basename ${{ steps.rockcraft.outputs.rock }})
echo "filename=$(basename ${{ steps.rockcraft.outputs.rock }})" >> $GITHUB_OUTPUT
- name: Upload ${{ inputs.rock-name }} for ${{ matrix.architecture }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.rock.outputs.filename }}
name: ${{ inputs.oci-archive-name }}-${{ steps.rock.outputs.filename }}
path: ${{ steps.rockcraft.outputs.rock }}
if-no-files-found: error

Expand All @@ -141,9 +141,9 @@ jobs:
- name: Merge single-arch rocks into multi-arch OCI archive
run: |
set -xe
ls ./*
ls ./${{ inputs.oci-archive-name }}*
buildah manifest create multi-arch-rock
for rock in `find *.rock/*`
for rock in `find ${{ inputs.oci-archive-name }}*.rock/*`
do
test -f $rock
buildah manifest add multi-arch-rock oci-archive:$rock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ summary: Hello World
description: The most basic example of a rock.
version: "1.0"
base: bare
build-base: ubuntu:22.04
build-base: ubuntu@22.04
license: Apache-2.0
platforms:
amd64:
Expand Down
15 changes: 15 additions & 0 deletions examples/mock-rock/1.1/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: mock-rock
summary: Hello World
description: The most basic example of a rock.
version: "1.1"
base: bare
build-base: ubuntu@22.04
license: Apache-2.0
platforms:
amd64:

parts:
hello:
plugin: nil
stage-packages:
- hello
35 changes: 29 additions & 6 deletions oci/mock-rock/_releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@
"edge": {
"target": "latest_beta"
},
"end-of-life": "2024-05-01T00:00:00Z"
"end-of-life": "2025-05-01T00:00:00Z"
},
"1.0-22.04": {
"candidate": {
"target": "199"
"target": "205"
},
"beta": {
"target": "199"
"target": "205"
},
"edge": {
"target": "199"

"target": "205"
},
"end-of-life": "2024-05-01T00:00:00Z"
"end-of-life": "2025-05-01T00:00:00Z"
},
"test": {
"beta": {
Expand All @@ -32,5 +31,29 @@
"target": "test_beta"
},
"end-of-life": "2026-05-01T00:00:00Z"
},
"1.1-22.04": {
"end-of-life": "2025-05-01T00:00:00Z",
"candidate": {
"target": "206"
},
"beta": {
"target": "206"
},
"edge": {
"target": "206"
}
},
"1-22.04": {
"end-of-life": "2025-05-01T00:00:00Z",
"candidate": {
"target": "206"
},
"beta": {
"target": "206"
},
"edge": {
"target": "206"
}
}
}
32 changes: 24 additions & 8 deletions oci/mock-rock/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,36 @@ version: 1

release:
latest:
end-of-life: "2024-05-01T00:00:00Z"
end-of-life: "2025-05-01T00:00:00Z"
candidate: 1.0-22.04_candidate
test:
end-of-life: "2026-05-01T00:00:00Z"
beta: 1.0-22.04_beta
upload:

upload:
- source: "canonical/oci-factory"
commit: 30e73ac0dc4705c12baacbcba74106c8eda2cf9a
directory: examples/mock-rock
commit: 7f080b50ba656538aee3819889090c173f06debd
directory: examples/mock-rock/1.0
release:
1.0-22.04:
end-of-life: "2024-05-01T00:00:00Z"
risks:
end-of-life: "2025-05-01T00:00:00Z"
risks:
- candidate
- edge
- beta
- source: "canonical/oci-factory"
commit: 7f080b50ba656538aee3819889090c173f06debd
directory: examples/mock-rock/1.1
release:
1.1-22.04:
end-of-life: "2025-05-01T00:00:00Z"
risks:
- candidate
- edge
- beta
1-22.04:
end-of-life: "2025-05-01T00:00:00Z"
risks:
- candidate
- edge
- beta
- beta

0 comments on commit 2d90ca7

Please sign in to comment.