Skip to content

Commit

Permalink
fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Sep 10, 2023
1 parent 45c2e34 commit e840ef1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
run: gh release upload
${{ github.event.inputs.version }}
$FILENAME.tar.xz
env:
GH_TOKEN: ${{ github.token }}
- uses: actions/upload-artifact@v3
with:
name: srcs
Expand Down Expand Up @@ -108,3 +110,5 @@ jobs:
run: gh release upload
${{ github.event.inputs.version }}
$FILENAME $FILENAME.asc
env:
GH_TOKEN: ${{ github.token }}
3 changes: 2 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions scripts/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ v_latest="$(npx -- semver --include-prerelease $versions | tail -n1)"
is_prerelease() {
deno run - <<EoTS
import { parse } from "https://deno.land/x/semver/mod.ts";
console.log(parse('$1')?.prerelease.length ? 'true' : 'false);
console.log(parse('$1')?.prerelease.length ? 'true' : 'false');
EoTS
}

Expand All @@ -38,28 +38,27 @@ major|minor|patch|prerelease)
;;
esac

if is_prerelease $v_new; then
prerelease=true
else
prerelease=false
fi

gum confirm "release $v_new?" || exit 1

git push origin main

gh release create \
v$v_new \
--draft=true \
--prelease=$(is_prerelease $v_new) \
--prerelease=$(is_prerelease $v_new) \
--generate-notes \
--notes-start-tag=$v_latest \
--title=$v_new \
--tag=$v_new \
--discussion-category=Announcements
--notes-start-tag=v$v_latest \
--title=$v_new

gh workflow run cd.yml -f version="$v_new"

run_id=$(gh run list --json databaseId --workflow cd | jq '.[0].databaseId')
# The above does not return the workflow ID
# Apparently GitHub “do not have the bandwidth” to add that 😒
# However the GitHub API is also slow so the below API call will not
# return the new workflow for an undefined amount of time 😒
sleep 4

run_id=$(gh run list --json databaseId --workflow=cd.yml | jq '.[0].databaseId')

gh workflow view --web $run_id

Expand All @@ -69,8 +68,9 @@ gum confirm "draft prepared, release $v_new?" || exit 1

gh release edit \
--verify-tag \
--tag $v_new \
--tag v$v_new \
--latest \
--draft=false
--draft=false \
--discussion-category=Announcements

gh release view $v_new --web
gh release view v$v_new --web

0 comments on commit e840ef1

Please sign in to comment.