~nromdotcom/gemif

gemif/scripts/release_version.sh -rwxr-xr-x 1.4 KiB
85dc63b9Norm MacLennan chore: upgrade linters and fix linting issues 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env sh
set -e

git_tag=`git describe --exact-match 2> /dev/null || echo ""`
if [ "$git_tag" != "" ]; then
    echo "Releasing $git_tag!"
    mv ./bin/gemif-darwin-amd64.tar.gz ./bin/gemif-darwin-amd64-$git_tag.tar.gz
    mv ./bin/gemif-darwin-arm64.tar.gz ./bin/gemif-darwin-arm64-$git_tag.tar.gz
    mv ./bin/gemif-linux-amd64.tar.gz ./bin/gemif-linux-amd64-$git_tag.tar.gz
    mv ./bin/gemif-linux-arm64.tar.gz ./bin/gemif-linux-arm64-$git_tag.tar.gz

    tar -czvf bundled-stories-$git_tag.tar.gz stories

    curl -H"Authorization: token $SRHT_TOKEN" https://git.sr.ht/api/~nromdotcom/repos/gemif/artifacts/$git_tag -F "file=@./bin/gemif-darwin-amd64-$git_tag.tar.gz"
    curl -H"Authorization: token $SRHT_TOKEN" https://git.sr.ht/api/~nromdotcom/repos/gemif/artifacts/$git_tag -F "file=@./bin/gemif-darwin-arm64-$git_tag.tar.gz"
    curl -H"Authorization: token $SRHT_TOKEN" https://git.sr.ht/api/~nromdotcom/repos/gemif/artifacts/$git_tag -F "file=@./bin/gemif-linux-amd64-$git_tag.tar.gz"
    curl -H"Authorization: token $SRHT_TOKEN" https://git.sr.ht/api/~nromdotcom/repos/gemif/artifacts/$git_tag -F "file=@./bin/gemif-linux-arm64-$git_tag.tar.gz"
    curl -H"Authorization: token $SRHT_TOKEN" https://git.sr.ht/api/~nromdotcom/repos/gemif/artifacts/$git_tag -F "file=@./bundled-stories-$git_tag.tar.gz"
    echo ""
    echo "DONE!"
else
    echo "Non-tagged commit, not releasing!"
fi