Compare commits
1 commit
main
...
24.12.26.1
Author | SHA1 | Date | |
---|---|---|---|
1482f84a6a |
1 changed files with 28 additions and 21 deletions
|
@ -23,30 +23,37 @@ jobs:
|
|||
/tmp/v/v -prod .
|
||||
- name: Upload binary as generic package and create a release
|
||||
run: |
|
||||
VERSION="$(date +'%y.%m.%d').$GITHUB_REF_NAME"
|
||||
#wget -q https://github.com/jqlang/jq/releases/latest/download/jq-linux-amd64 -o jq
|
||||
#chmod +x jq
|
||||
set -e
|
||||
VERSION="$(date +'%y.%m.%d').$(git rev-parse --short HEAD)"
|
||||
echo Download jq
|
||||
wget -q https://github.com/jqlang/jq/releases/latest/download/jq-linux-amd64 -O jq
|
||||
chmod +x jq
|
||||
|
||||
# Create a tag
|
||||
#git tag "$VERSION"
|
||||
#git push --tags
|
||||
echo Create a tag
|
||||
git tag "$VERSION"
|
||||
git push --tags
|
||||
|
||||
# Create a release
|
||||
#curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
|
||||
# -H "Content-Type: application/json" \
|
||||
# --data '{"name": "'$VERSION'", "tag": "'$VERSION'"}' \
|
||||
# "https://code.bcarlin.net/api/repos/actions/setup-browser/releases"
|
||||
echo Create a release
|
||||
OUT=$(curl --silent -X POST -H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data '{"name": "'$VERSION'", "tag_name": "'$VERSION'"}' \
|
||||
"https://code.bcarlin.net/api/v1/repos/actions/setup-browser/releases" \
|
||||
| tee /dev/stderr)
|
||||
|
||||
#REL_ID=$(curl -H "Authorization: token $GITHUB_TOKEN" "https://forgejo.example.com/api/repos/actions/setup-browser/releases/latest" | ./jq .id)
|
||||
UP_URL=$(echo "$OUT" | ./jq -r .upload_url )
|
||||
echo "upload url: $UP_URL"
|
||||
|
||||
# Add the binary to the release
|
||||
#curl -X 'POST' --header "Authorization: token $GITHUB_TOKEN" \
|
||||
# "https://code.bcarlin.net/api/v1/repos/actions/setup-browser/releases/$REL_ID/assets?name=setup-browser" \
|
||||
# -H 'accept: application/json' \
|
||||
# -H 'Content-Type: multipart/form-data' \
|
||||
# -F 'external_url='
|
||||
#REL_ID=$(curl --silent -H "Authorization: token $GITHUB_TOKEN" "https://code.bcarlin.net/api/v1/repos/actions/setup-browser/releases/latest" | ./jq .id)
|
||||
|
||||
echo Add the binary to the release
|
||||
set -x
|
||||
curl -X 'POST' --header "Authorization: token $GITHUB_TOKEN" \
|
||||
"$UP_URL" \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: multipart/form-data' \
|
||||
-F 'attachment=@setup-browser'
|
||||
|
||||
# Upload the binary as a generic package
|
||||
curl -v --header "Authorization: token $GITHUB_TOKEN" \
|
||||
--upload-file setup-browser \
|
||||
"https://code.bcarlin.net/api/packages/actions/generic/setup-browser/$VERSION/setup-browser"
|
||||
#curl -v --header "Authorization: token $GITHUB_TOKEN" \
|
||||
# --upload-file setup-browser \
|
||||
# "https://code.bcarlin.net/api/packages/actions/generic/setup-browser/$VERSION/setup-browser"
|
||||
|
|
Loading…
Reference in a new issue