refactor: migrate plugin updates from GitHub to Mahgit
Build plugin release / release (push) Failing after 5s
Build plugin release / release (push) Failing after 5s
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
name: Build plugin release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
code: read
|
||||
releases: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Validate version and build ZIP
|
||||
env:
|
||||
RELEASE_TAG: ${{ gitea.ref_name }}
|
||||
run: |
|
||||
VERSION="${RELEASE_TAG#v}"
|
||||
grep -q "Version: ${VERSION}$" dabestaniha-authenticate-bridge.php
|
||||
mkdir -p build/mahak-authenticate-bridge dist
|
||||
rsync -a \
|
||||
--exclude='.git/' \
|
||||
--exclude='.gitea/' \
|
||||
--exclude='build/' \
|
||||
--exclude='dist/' \
|
||||
--exclude='test/' \
|
||||
./ build/mahak-authenticate-bridge/
|
||||
cd build
|
||||
zip -qr ../dist/mahak-authenticate-bridge.zip mahak-authenticate-bridge
|
||||
|
||||
- name: Publish Gitea release
|
||||
env:
|
||||
GITEA_API_URL: ${{ gitea.api_url }}
|
||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
RELEASE_TAG: ${{ gitea.ref_name }}
|
||||
run: |
|
||||
RELEASE_JSON="$(curl --fail-with-body --silent --show-error \
|
||||
--request POST \
|
||||
--header "Authorization: token ${GITEA_TOKEN}" \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data "{\"tag_name\":\"${RELEASE_TAG}\",\"name\":\"${RELEASE_TAG}\",\"draft\":false,\"prerelease\":false}" \
|
||||
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases")"
|
||||
RELEASE_ID="$(printf '%s' "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -n 1 | cut -d: -f2)"
|
||||
test -n "$RELEASE_ID"
|
||||
curl --fail-with-body --silent --show-error \
|
||||
--request POST \
|
||||
--header "Authorization: token ${GITEA_TOKEN}" \
|
||||
--form 'attachment=@dist/mahak-authenticate-bridge.zip' \
|
||||
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=mahak-authenticate-bridge.zip"
|
||||
Reference in New Issue
Block a user