diff --git a/.github/workflows/preparerelease.yml b/.github/workflows/preparerelease.yml index 6dda536d..54215b54 100644 --- a/.github/workflows/preparerelease.yml +++ b/.github/workflows/preparerelease.yml @@ -3,6 +3,10 @@ name: Prepare Release on: release: types: [ created ] + push: + branches: [ master ] + paths: + - 'VERSION' workflow_dispatch: inputs: limitarch: @@ -15,6 +19,15 @@ on: - '386' - arm/v7 - arm64 + limitimg: + description: Limit to this image + required: false + type: choice + options: + - '' + - bullseye + - buster + - stretch jobs: prepare-release: @@ -34,7 +47,16 @@ jobs: buildkitd-flags: --debug - 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: UPLOAD_URL: ${{ secrets.UPLOAD_URL }} 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 diff --git a/contrib/docker/build.sh b/contrib/docker/build.sh index f9ae2ced..7ff51366 100755 --- a/contrib/docker/build.sh +++ b/contrib/docker/build.sh @@ -12,10 +12,9 @@ if [[ -n "$LIMITARCH" ]]; then fi if [[ -z "$1" ]] || [[ "x$1" == "xrelease" ]]; then UPLOAD_URL= -elif [[ -z "$UPLOAD_URL" ]]; then - UPLOAD_URL="http://$1/ebusdreleaseupload.php" +else + UPLOAD_CREDENTIALS=${UPLOAD_CREDENTIALS:-'anonymous:build'} fi -UPLOAD_CREDENTIALS=${UPLOAD_CREDENTIALS:-'anonymous:build'} version=`cat ../../VERSION` source='../..' images='bullseye' @@ -35,9 +34,12 @@ elif [[ "x$1" = "xrelease" ]]; then extratag="-t $tagprefix:latest" else namesuffix='.build' - target=build + target=deb 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" fi diff --git a/contrib/docker/update.sh b/contrib/docker/update.sh index d19063ad..99b9259a 100755 --- a/contrib/docker/update.sh +++ b/contrib/docker/update.sh @@ -32,7 +32,8 @@ replaceTemplate if [[ -n "$1" ]]; then # build releases update 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' replaceTemplate fi