diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index cf8bdd2..a2f6f6c 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -7,6 +7,9 @@ on: tags: - '*' +permissions: + contents: write + jobs: upload-asset: runs-on: ubuntu-latest @@ -37,11 +40,18 @@ jobs: - name: Upload zip to Gitea Release env: GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITEA_URL: ${{ github.server_url }} + API_URL: ${{ github.api_url }} + SERVER_URL: ${{ github.server_url }} REPO: ${{ github.repository }} TAG: ${{ github.ref_name }} run: | - RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_URL/api/v1/repos/$REPO/releases/tags/$TAG") + if [ -z "$API_URL" ]; then + API_URL="${SERVER_URL}/api/v1" + fi + + 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) if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then @@ -50,13 +60,13 @@ jobs: -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Release $TAG\"}" \ - "$GITEA_URL/api/v1/repos/$REPO/releases") + "$API_URL/repos/$REPO/releases") RELEASE_ID=$(echo "$CREATE_RES" | jq -r .id) fi echo "Uploading laps.zip to release ID $RELEASE_ID..." - curl -s -X POST \ + curl -s -f -X POST \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "attachment=@release/laps.zip" \ - "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=laps.zip" + "$API_URL/repos/$REPO/releases/$RELEASE_ID/assets?name=laps.zip" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bf3366..9f1e03b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +## 3.4.0 - 2026-09-26 + ### Changed - raised minimum required PHP version to 7.4 to align with WordPress 7.0+ - added `Requires at least: 7.0` to plugin header diff --git a/laps.php b/laps.php index 6c2d240..8d93014 100644 --- a/laps.php +++ b/laps.php @@ -5,7 +5,7 @@ Plugin Name: Laps Plugin URI: https://github.com/Rarst/laps Description: Light WordPress profiler. Author: Andrey “Rarst” Savchenko -Version: 3.3.7 +Version: 3.4.0 Author URI: https://www.rarst.net/ Requires at least: 7.0 Requires PHP: 7.4