Use composer:2 container in Gitea workflows
This commit is contained in:
1 parent
d035dbe215
commit
2bdb8c67da
2 files changed
+5
-17
No files matched your search
@@ -14,15 +14,9 @@ jobs:
|
|||||||
upload-asset:
|
upload-asset:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:7.4-cli
|
image: composer:2
|
||||||
|
|
||||||
steps:
|
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
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build release zip
|
- name: Build release zip
|
||||||
@@ -52,16 +46,16 @@ jobs:
|
|||||||
echo "Target API: $API_URL/repos/$REPO"
|
echo "Target API: $API_URL/repos/$REPO"
|
||||||
|
|
||||||
RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API_URL/repos/$REPO/releases/tags/$TAG")
|
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..."
|
echo "Creating release for tag $TAG..."
|
||||||
CREATE_RES=$(curl -s -X POST \
|
CREATE_RES=$(curl -s -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Release $TAG\"}" \
|
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Release $TAG\"}" \
|
||||||
"$API_URL/repos/$REPO/releases")
|
"$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
|
fi
|
||||||
|
|
||||||
echo "Uploading laps.zip to release ID $RELEASE_ID..."
|
echo "Uploading laps.zip to release ID $RELEASE_ID..."
|
||||||
|
|||||||
@@ -10,15 +10,9 @@ jobs:
|
|||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:7.4-cli
|
image: composer:2
|
||||||
|
|
||||||
steps:
|
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
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
|
|||||||
Reference in new issue
Block a user