attempt to use the API before installing Go
This commit is contained in:
parent
7ee4538eff
commit
beda41fdef
@ -34,9 +34,31 @@ jobs:
|
||||
ls cordle-${VERSION}-linux-amd64.tar.gz* # For debugging
|
||||
|
||||
- name: Create Release
|
||||
uses: actions/release-action@main
|
||||
with:
|
||||
files: |
|
||||
release/*.tar.gz
|
||||
release/*.sha256
|
||||
api_key: ${{ secrets.RELEASE_TOKEN }}
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
|
||||
# Create release
|
||||
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"${VERSION}\",
|
||||
\"name\": \"Cordle ${VERSION}\",
|
||||
\"body\": \"Release ${VERSION}\"
|
||||
}" > release_response.json
|
||||
|
||||
RELEASE_ID=$(cat release_response.json | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
|
||||
|
||||
# Upload tarball
|
||||
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=cordle-${VERSION}-linux-amd64.tar.gz" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/gzip" \
|
||||
--data-binary @release/cordle-${VERSION}-linux-amd64.tar.gz
|
||||
|
||||
# Upload checksum
|
||||
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=cordle-${VERSION}-linux-amd64.tar.gz.sha256" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: text/plain" \
|
||||
--data-binary @release/cordle-${VERSION}-linux-amd64.tar.gz.sha256
|
||||
|
||||
Loading…
Reference in New Issue
Block a user