push deb to artifacts

This commit is contained in:
John
2022-02-19 10:46:54 +01:00
parent e013a998f8
commit 4139d7b3bf
3 changed files with 32 additions and 7 deletions
+23 -1
View File
@@ -3,6 +3,10 @@ name: Prepare Release
on: on:
release: release:
types: [ created ] types: [ created ]
push:
branches: [ master ]
paths:
- 'VERSION'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
limitarch: limitarch:
@@ -15,6 +19,15 @@ on:
- '386' - '386'
- arm/v7 - arm/v7
- arm64 - arm64
limitimg:
description: Limit to this image
required: false
type: choice
options:
- ''
- bullseye
- buster
- stretch
jobs: jobs:
prepare-release: prepare-release:
@@ -34,7 +47,16 @@ jobs:
buildkitd-flags: --debug buildkitd-flags: --debug
- -
name: build name: build
run: cd contrib/docker && ./update.sh all && LIMITARCH=${{ github.event.inputs.limitarch }} ./build.sh deb run: cd contrib/docker && ./update.sh all && ./build.sh deb
env: env:
UPLOAD_URL: ${{ secrets.UPLOAD_URL }} UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
UPLOAD_CREDENTIALS: ${{ secrets.UPLOAD_CREDENTIALS }} UPLOAD_CREDENTIALS: ${{ secrets.UPLOAD_CREDENTIALS }}
LIMITARCH: ${{ github.event.inputs.limitarch }}
LIMITIMG: ${{ github.event.inputs.limitimg }}
-
name: archive
uses: actions/upload-artifact@v2
with:
name: debian packages
path: |
contrib/docker/out
+7 -5
View File
@@ -12,10 +12,9 @@ if [[ -n "$LIMITARCH" ]]; then
fi fi
if [[ -z "$1" ]] || [[ "x$1" == "xrelease" ]]; then if [[ -z "$1" ]] || [[ "x$1" == "xrelease" ]]; then
UPLOAD_URL= UPLOAD_URL=
elif [[ -z "$UPLOAD_URL" ]]; then else
UPLOAD_URL="http://$1/ebusdreleaseupload.php"
fi
UPLOAD_CREDENTIALS=${UPLOAD_CREDENTIALS:-'anonymous:build'} UPLOAD_CREDENTIALS=${UPLOAD_CREDENTIALS:-'anonymous:build'}
fi
version=`cat ../../VERSION` version=`cat ../../VERSION`
source='../..' source='../..'
images='bullseye' images='bullseye'
@@ -35,9 +34,12 @@ elif [[ "x$1" = "xrelease" ]]; then
extratag="-t $tagprefix:latest" extratag="-t $tagprefix:latest"
else else
namesuffix='.build' namesuffix='.build'
target=build target=deb
images='bullseye buster stretch' images='bullseye buster stretch'
outputFmt= if [[ -n "$LIMITIMG" ]]; then
images=$(echo " $images " | sed -e "s#.* \($LIMITIMG\) .*#\1#")
fi
outputFmt='-o out/%IMAGE%'
tagsuffix=":v$version-prep" tagsuffix=":v$version-prep"
fi fi
+2 -1
View File
@@ -32,7 +32,8 @@ replaceTemplate
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
# build releases update # build releases update
make='./make_all.sh' make='./make_all.sh'
upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fs -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION" || echo "failed"; done; fi' upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fsSk -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION" || echo "failed"; done; fi'
upload_lines+='\n\n\nFROM scratch as deb\nCOPY --from=build /build/*.deb /'
namesuffix='.build' namesuffix='.build'
replaceTemplate replaceTemplate
fi fi