diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 9d85b77..3b9f22a 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -28,11 +28,8 @@ on: type: string default: "false" -# Same group as ci.yml: both cargo builds share the Pi's 4 cores and the -# onionwire-cargo-registry volume. A separate group raced tests and produced -# Permission denied (os error 13) on /target/debug/deps/* binaries. concurrency: - group: onionwire-ci-pi + group: onionwire-release cancel-in-progress: false env: @@ -224,21 +221,6 @@ jobs: - name: Show runner arch run: uname -m && echo "target=$TARGET" - - name: Ensure docker CLI (amd64 dind job image has none) - run: | - set -euo pipefail - if ! command -v docker >/dev/null 2>&1; then - curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.3.1.tgz \ - | tar xz -C /tmp - install -m 755 /tmp/docker/docker /usr/local/bin/docker - fi - docker version - if [ ! -S /var/run/docker.sock ]; then - echo "docker.sock is not mounted into the job container" >&2 - ls -l /var/run || true - exit 1 - fi - - name: Build ${{ env.TARGET }} in a rust container run: | set -euo pipefail @@ -355,7 +337,7 @@ jobs: cleanup: needs: [version, aarch64, x86_64, publish] - if: ${{ always() && needs.version.result == 'success' && needs.version.outputs.created_tag == 'true' && needs.publish.result != 'success' }} + if: ${{ always() && needs.version.outputs.created_tag == 'true' && (needs.aarch64.result != 'success' || needs.x86_64.result != 'success' || needs.publish.result != 'success') }} runs-on: docker timeout-minutes: 10 steps: @@ -366,7 +348,6 @@ jobs: TAG: ${{ needs.version.outputs.tag }} run: | set -euo pipefail - FORGEJO_TOKEN=$(printf '%s' "$FORGEJO_TOKEN" | tr -d '\r\n') echo "fail-closed: removing tag $TAG created by this run" code=$(curl -sS --http1.1 -o /tmp/rel.json -w '%{http_code}' \ -H "Authorization: Bearer $FORGEJO_TOKEN" \ @@ -374,17 +355,10 @@ jobs: if [ "$code" = "200" ]; then rid=$(python3 -c "import json; print(json.load(open('/tmp/rel.json'))['id'])") echo "deleting incomplete release id $rid" - curl -sS --http1.1 -X DELETE \ - -H "Authorization: Bearer $FORGEJO_TOKEN" \ + curl -sS --http1.1 -X DELETE -H "Authorization: Bearer $FORGEJO_TOKEN" \ "$REPO_API/releases/$rid" -o /dev/null -w "DELETE release HTTP %{http_code}\n" else echo "no release for $TAG (HTTP $code)" fi - del=$(curl -sS --http1.1 -o /tmp/tag-del.json -w '%{http_code}' -X DELETE \ - -H "Authorization: Bearer $FORGEJO_TOKEN" \ - "$REPO_API/tags/$TAG") - echo "DELETE tag HTTP $del" - if [ "$del" != "204" ] && [ "$del" != "404" ]; then - cat /tmp/tag-del.json >&2 || true - exit 1 - fi + curl -sS --http1.1 -X DELETE -H "Authorization: Bearer $FORGEJO_TOKEN" \ + "$REPO_API/tags/$TAG" -o /dev/null -w "DELETE tag HTTP %{http_code}\n"