|
53 | 53 | echo "RELEASE=bleeding" >> $GITHUB_ENV
|
54 | 54 | echo "PRERELEASE=true" >> $GITHUB_ENV
|
55 | 55 | fi
|
| 56 | + TAG_NAME=${GITHUB_REF#refs/tags/} |
| 57 | + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV |
56 | 58 |
|
57 | 59 | - name: Install
|
58 | 60 | run: ./scripts/linux/ci_install_core.sh
|
@@ -166,3 +168,31 @@ jobs:
|
166 | 168 | token: ${{ secrets.GITHUB_TOKEN }}
|
167 | 169 | tag_name: ${{ env.RELEASE }}
|
168 | 170 | files: projectGenerator-linux-armv7l-gui.gz
|
| 171 | + |
| 172 | + - name: Get Release ID for the Tag |
| 173 | + id: get_release |
| 174 | + if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') |
| 175 | + run: | |
| 176 | + RELEASE_ID=$(curl -s \ |
| 177 | + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ |
| 178 | + -H "Accept: application/vnd.github.v3+json" \ |
| 179 | + https://api.github.com/repos/openframeworks/projectGenerator/releases | jq -r '.[] | select(.tag_name=="${{ env.TAG_NAME }}") | .id') |
| 180 | +
|
| 181 | + if [ -z "$RELEASE_ID" ]; then |
| 182 | + echo "Release ID not found for tag: ${{ env.TAG_NAME }}" |
| 183 | + exit 1 |
| 184 | + fi |
| 185 | +
|
| 186 | + echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV |
| 187 | + echo "Found Release ID: ${RELEASE_ID}" |
| 188 | +
|
| 189 | + - name: Update Release Description |
| 190 | + if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') |
| 191 | + run: | |
| 192 | + curl -X PATCH \ |
| 193 | + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ |
| 194 | + -H "Accept: application/vnd.github.v3+json" \ |
| 195 | + https://api.github.com/repos/openframeworks/projectGenerator/releases/${{ env.RELEASE_ID }} \ |
| 196 | + -d '{ |
| 197 | + "body": "Updated release for tag: ${{ env.TAG_NAME }} - '"$(date '+%Y-%m-%d %H:%M:%S')"'" |
| 198 | + }' |
0 commit comments