@@ -25,52 +25,4 @@ cp dist/phrase_linux_arm64 dist/linux/arm64
2525
2626docker buildx build --tag " ${IMAGE} " --tag ${IMAGE_LATEST} --platform linux/amd64,linux/arm64 -f ./Dockerfile --push .
2727
28- # Create release
29- function create_release_data()
30- {
31- cat << EOF
32- {
33- "tag_name": "${VERSION} ",
34- "name": "${VERSION} ",
35- "draft": true,
36- "prerelease": false,
37- "body": "https://github.com/phrase/phrase-cli/blob/master/CHANGELOG.md"
38- }
39- EOF
40- }
41-
42- echo " Create release $VERSION "
43- api_url=" https://api.github.com/repos/phrase/phrase-cli/releases"
44- response=" $( curl -H " Authorization: token ${GITHUB_TOKEN} " --data " $( create_release_data) " ${api_url} ) "
45- release_id=$( echo $response | python -c " import sys, json; print(json.load(sys.stdin).get('id', ''))" )
46-
47- if [ -z " $release_id " ]
48- then
49- echo " Failed to create GitHub release"
50- echo $response
51- exit 1
52- else
53- echo " New release created created with id: ${release_id} "
54- fi
55-
56- # Upload artifacts
57- DIST_DIR=" ./dist"
58- for file in " $DIST_DIR " /* ; do
59- if [ -f " $file " ]; then
60- echo " Uploading ${file} "
61- asset=" https://uploads.github.com/repos/phrase/phrase-cli/releases/${release_id} /assets?name=$( basename " $file " ) "
62- curl -sS --data-binary @" $file " -H " Authorization: token ${GITHUB_TOKEN} " -H " Content-Type: application/octet-stream" $asset > /dev/null
63- echo Hash: $( sha256sum $file )
64- fi
65- done
66-
67- echo " Publishing release"
68- curl \
69- --silent \
70- -X PATCH \
71- -H " Authorization: token ${GITHUB_TOKEN} " \
72- -H " Accept: application/vnd.github.v3+json" \
73- " https://api.github.com/repos/phrase/phrase-cli/releases/${release_id} " \
74- -d ' {"draft": false}' > /dev/null
75-
76- echo " Release successful"
28+ echo " Artifacts built and ready in dist/ directory. GitHub Release creation handled in GitHub Actions workflow."
0 commit comments