diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index a2f6f6c..4d71c8f 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -14,15 +14,9 @@ jobs: upload-asset: runs-on: ubuntu-latest container: - image: php:7.4-cli + image: composer:2 steps: - - name: Install system dependencies - run: | - apt-get update -qq - apt-get install -y -qq git unzip zip curl jq - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - - uses: actions/checkout@v3 - name: Build release zip @@ -52,16 +46,16 @@ jobs: echo "Target API: $API_URL/repos/$REPO" RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API_URL/repos/$REPO/releases/tags/$TAG") - RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r .id) + RELEASE_ID=$(echo "$RELEASE_JSON" | php -r '$d = json_decode(file_get_contents("php://stdin")); echo $d->id ?? "";') - if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then + if [ -z "$RELEASE_ID" ]; then echo "Creating release for tag $TAG..." CREATE_RES=$(curl -s -X POST \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Release $TAG\"}" \ "$API_URL/repos/$REPO/releases") - RELEASE_ID=$(echo "$CREATE_RES" | jq -r .id) + RELEASE_ID=$(echo "$CREATE_RES" | php -r '$d = json_decode(file_get_contents("php://stdin")); echo $d->id ?? "";') fi echo "Uploading laps.zip to release ID $RELEASE_ID..." diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index abf1fea..d5c4406 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -10,15 +10,9 @@ jobs: tests: runs-on: ubuntu-latest container: - image: php:7.4-cli + image: composer:2 steps: - - name: Install system dependencies - run: | - apt-get update -qq - apt-get install -y -qq git unzip curl - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - - uses: actions/checkout@v3 - name: Install Composer dependencies