Update main.yml
This commit is contained in:
1 parent
cb369a99b6
commit
45198f1f35
1 file changed
+16
-7
@@ -12,20 +12,31 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install jq
|
- name: Install dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install -y jq
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y jq zip
|
||||||
|
|
||||||
|
- name: Create release ZIP
|
||||||
|
run: |
|
||||||
|
zip -r community_bridge.zip . -x ".git/*" ".github/*"
|
||||||
|
|
||||||
|
- name: Upload ZIP to release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: community_bridge.zip
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Send webhook notification
|
- name: Send webhook notification
|
||||||
env:
|
env:
|
||||||
WEBHOOK_URL: ${{ secrets.RELEASE_WEBHOOK_URL }}
|
WEBHOOK_URL: ${{ secrets.RELEASE_WEBHOOK_URL }}
|
||||||
run: |
|
run: |
|
||||||
# Extract repository name and release details
|
|
||||||
REPO_NAME=$(basename "$GITHUB_REPOSITORY")
|
REPO_NAME=$(basename "$GITHUB_REPOSITORY")
|
||||||
RELEASE_VERSION=$(jq -r '.release.tag_name // "Unknown Version"' "$GITHUB_EVENT_PATH")
|
RELEASE_VERSION=$(jq -r '.release.tag_name // "Unknown Version"' "$GITHUB_EVENT_PATH")
|
||||||
TITLE="$REPO_NAME $RELEASE_VERSION"
|
TITLE="$REPO_NAME $RELEASE_VERSION"
|
||||||
DESCRIPTION=$(jq -r '.release.body // "No description provided."' "$GITHUB_EVENT_PATH")
|
DESCRIPTION=$(jq -r '.release.body // "No description provided."' "$GITHUB_EVENT_PATH")
|
||||||
|
|
||||||
# Construct JSON payload
|
|
||||||
PAYLOAD=$(jq -n \
|
PAYLOAD=$(jq -n \
|
||||||
--arg title "$TITLE" \
|
--arg title "$TITLE" \
|
||||||
--arg description "$DESCRIPTION" \
|
--arg description "$DESCRIPTION" \
|
||||||
@@ -57,17 +68,15 @@ jobs:
|
|||||||
"type": 2,
|
"type": 2,
|
||||||
"style": 5,
|
"style": 5,
|
||||||
"label": "Get The Latest Community Bridge Release",
|
"label": "Get The Latest Community Bridge Release",
|
||||||
"url": "https://github.com/The-Order-Of-The-Sacred-Framework/community_bridge/tree/main"
|
"url": "https://github.com/The-Order-Of-The-Sacred-Framework/community_bridge/releases/latest"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}')
|
}')
|
||||||
|
|
||||||
# Debugging: Print the payload for verification
|
|
||||||
echo "$PAYLOAD"
|
echo "$PAYLOAD"
|
||||||
|
|
||||||
# Send webhook
|
|
||||||
curl -X POST "$WEBHOOK_URL" \
|
curl -X POST "$WEBHOOK_URL" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
--data-raw "$PAYLOAD" || exit 1
|
--data-raw "$PAYLOAD" || exit 1
|
||||||
Reference in new issue
Block a user