Update .gitea/workflows/build.yml
Some checks failed
OGX-Mini / OGX-Mini (OGX-Mini, PI_PICOW) (push) Has been cancelled
OGX-Mini / OGX-Mini (OGX-Mini, PI_PICO) (push) Has been cancelled

This commit is contained in:
Sthope 2025-03-17 22:43:00 +01:00
parent 2b51e089c2
commit 2062c86e2d

View File

@ -18,16 +18,19 @@ jobs:
- name: Compare Versions
run: |
GITHUB_REPO="wiredopposite/OGX-Mini"
echo "GITHUB_REPO=$GITHUB_REPO" >> $GITEA_ENV
GITEA_URL="https://git.sthope.dev"
GITEA_REPO="sthope/OGX-Mini"
GITHUB_VERSION=$(curl -s "https://api.github.com/repos/$GITHUB_REPO/releases/latest" | jq -r .tag_name)
GITEA_VERSION=$(curl -s "$GITEA_URL/api/v1/repos/$GITEA_REPO/releases/latest" -H 'accept: application/json' | jq -r '.tag_name')
echo "GITHUB_REPO=$GITHUB_REPO" >> $GITEA_ENV
echo "GITHUB_VERSION=$GITHUB_VERSION" >> $GITEA_ENV
GITEA_VERSION=$(curl -s "$GITEA_URL/api/v1/repos/$GITEA_REPO/releases/latest" -H 'accept: application/json' | jq -r '.tag_name')
echo "GITEA_VERSION=$GITEA_VERSION" >> $GITEA_ENV
echo "GitHub Latest Version: $GITHUB_VERSION"
echo "Gitea Latest Version: $GITEA_VERSION"
echo "GITEA_VERSION=$GITEA_VERSION" >> $GITEA_ENV
if [ "$(printf '%s\n' "$GITEA_VERSION" "$GITHUB_VERSION" | sort -V | head -n1)" = "$GITHUB_VERSION" ]; then
echo "❌❌GitHub release is older or the same. Stopping workflow.❌❌"
@ -36,9 +39,7 @@ jobs:
echo "PB_TITLE=${{ matrix.project_name }}" >> $GITEA_ENV
curl -u ${PB_TOKEN}: -X POST https://api.pushbullet.com/v2/pushes \
--header 'Content-Type: application/json' \
--data-binary '{"type": "note", \
"title": "$PB_TITLE", \
"body": "$PB_TITLE new: $GITHUB_VERSION" }'
--data-binary '{"type": "note", "title": "$PB_TITLE", "body": "$PB_TITLE new: $GITHUB_VERSION" }'
else
echo "✅✅GitHub release is newer. Continuing workflow.✅✅"
PB_TOKEN="${{ secrets.PB_TOKEN }}"