Skip to content

Commit daf67d4

Browse files
committed
.githb: add versioning and upload to release
Signed-off-by: Joachim Wiberg <[email protected]>
1 parent a0f4025 commit daf67d4

File tree

1 file changed

+45
-11
lines changed

1 file changed

+45
-11
lines changed

.github/workflows/build-push.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,28 +79,62 @@ jobs:
7979
with:
8080
pattern: artifact-*
8181
merge-multiple: true
82+
- name: Artifact Variables
83+
id: vars
84+
run: |
85+
VER=${{ inputs.ver }}
86+
SFX=""
87+
if [[ "${VER}" =~ ^v.* ]]; then
88+
TAG=${VER#?}
89+
SFX="-$VER"
90+
else
91+
VER=edge
92+
TAG=$VER
93+
fi
94+
echo "ver=$VER" >> $GITHUB_OUTPUT
95+
echo "tag=$TAG" >> $GITHUB_OUTPUT
96+
echo "sfx=$SFX" >> $GITHUB_OUTPUT
8297
- name: Prepare Aritfacts
8398
run: |
99+
SFX=${{ steps.vars.outputs.sfx }}
84100
for file in *.tar.gz; do
85101
name=$(basename ${file} .tar.gz)
86102
echo "Found: $name"
87103
tar xf ${file}
88-
mv ${name}/rootfs-oci ${name}-oci
104+
mv ${name}/rootfs-oci ${name}-oci${SFX}
105+
tar cfz ${name}-oci.tar.gz ${name}-oci${SFX}
89106
done
90-
ls -la *-oci/
107+
ls -la *-oci${SFX}/
108+
ls -l *.tar.gz
91109
- name: Log in to registry
92110
run: |
93111
echo "${{ secrets.token }}" | buildah login -u ${{ github.actor }} --password-stdin ghcr.io
94-
- name: Push image
112+
- name: Push image(s)
95113
run: |
114+
set -x
96115
IMG=${{ inputs.app }}
116+
TAG=${{ steps.vars.outputs.tag }}
117+
SFX=${{ steps.vars.outputs.sfx }}
97118
URL=ghcr.io/${{ github.repository_owner }}/${IMG}
98-
VER=${{ inputs.ver }}
99-
[[ "${VER}" =~ ^v.* ]] || VER=edge
100-
echo "URL=${URL}"
101-
echo "VER=${VER}"
102-
set -x
103119
buildah manifest create ${IMG}
104-
buildah manifest add ${IMG} oci:${IMG}-amd64-oci
105-
buildah manifest add ${IMG} oci:${IMG}-arm64-oci
106-
buildah manifest push --all -f oci ${IMG} docker://${URL}:${VER}
120+
buildah manifest add ${IMG} oci:${IMG}-amd64-oci${SFX}
121+
buildah manifest add ${IMG} oci:${IMG}-arm64-oci${SFX}
122+
buildah manifest push --all -f oci ${IMG} docker://${URL}:${TAG}
123+
- uses: ncipollo/release-action@v1
124+
with:
125+
allowUpdates: true
126+
omitName: true
127+
omitBody: true
128+
omitBodyDuringUpdate: true
129+
prerelease: true
130+
tag: ${{ steps.vars.outputs.ver }}
131+
token: ${{ secrets.GITHUB_TOKEN }}
132+
artifacts: "*.tar.gz"
133+
- name: Summary
134+
run: |
135+
cat <<EOF >> $GITHUB_STEP_SUMMARY
136+
# Edge Build of ${{ inputs.app }} Complete! :rocket:
137+
138+
For the public download links of these build artifacts, please see:
139+
<https://github.com/kernelkit/curiOS/releases/tag/edge>
140+
EOF

0 commit comments

Comments
 (0)