File: upload-github

package info (click to toggle)
rclone 1.60.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 34,820 kB
  • sloc: sh: 957; xml: 857; python: 655; javascript: 612; makefile: 264; ansic: 101; php: 74
file content (46 lines) | stat: -rwxr-xr-x 1,034 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
#
# Upload a release
#
# Needs the gh tool from https://github.com/cli/cli

set -e

REPO="rclone/rclone"

if [ "$1" == "" ]; then
    echo "Syntax: $0 Version"
    exit 1
fi
VERSION="$1"
ANCHOR=$(grep '^## v' docs/content/changelog.md | head -1 | sed 's/^## //; s/[^A-Za-z0-9-]/-/g; s/--*/-/g')

cat > "/tmp/${VERSION}-release-notes" <<EOF
This is the ${VERSION} release of rclone.

Full details of the changes can be found in [the changelog](https://rclone.org/changelog/#${ANCHOR}).
EOF

echo "Making release ${VERSION} anchor ${ANCHOR} to repo ${REPO}"

gh release create "${VERSION}" \
    --repo ${REPO} \
    --title "rclone ${VERSION}" \
    --notes-file "/tmp/${VERSION}-release-notes"

for build in build/*; do
    case $build in
        *current*) continue ;;
        *testbuilds*) continue ;;
    esac
    echo "Uploading ${build} "
    gh release upload "${VERSION}" \
        --clobber \
        --repo ${REPO} \
        "${build}"
done

gh release view "${VERSION}" \
    --repo ${REPO}

echo "Done"