Debug GH actions #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Debug GitHub Actions | |
on: | |
push: | |
branches: | |
- main | |
env: | |
PACKAGE_NAME: metaanalyser | |
PACKAGE_VERSION: 0.1.0 | |
jobs: | |
debug: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create Dummy File | |
run: echo "This is a dummy file" > dummy_file.txt | |
- name: Create Public Release | |
run: | | |
RESPONSE=$(curl -s -X POST \ | |
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \ | |
-d '{ | |
"tag_name": "v${{ env.PACKAGE_VERSION }}", | |
"target_commitish": "main", | |
"name": "Release v${{ env.PACKAGE_VERSION }}", | |
"body": "Debugging release.", | |
"draft": true, | |
"prerelease": true | |
}' \ | |
https://api.github.com/repos/${{ github.repository }}/releases) | |
echo "Full API Response: $RESPONSE" | |
UPLOAD_URL=$(echo "$RESPONSE" | jq -r '.upload_url') | |
echo "UPLOAD_URL=${UPLOAD_URL}" >> $GITHUB_ENV | |
- name: Debug UPLOAD_URL | |
run: | | |
echo "Original UPLOAD_URL: $UPLOAD_URL" | |
UPLOAD_URL="${UPLOAD_URL/\{?name,label\}/?name=${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_Linux.tar.gz}" | |
echo "Modified UPLOAD_URL: $UPLOAD_URL" | |
- name: Upload Dummy File to Release | |
run: | | |
curl -s -X POST "$UPLOAD_URL" \ | |
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \ | |
-H "Content-Type: text/plain" \ | |
--data-binary @dummy_file.txt |