Skip to content

Commit 4e40225

Browse files
committed
Add release::upload
1 parent c5e35e3 commit 4e40225

4 files changed

Lines changed: 32 additions & 1 deletion

File tree

β€Ž.bee/plugins/release/release.bashβ€Ž

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,32 @@ release::publish() {
88
git tag "${version}"
99
git push --tags
1010
github::create_release
11+
release::upload "${version}"
12+
}
13+
14+
release::upload() {
15+
local tag="$1"
16+
17+
# Choose run to download artifacts from
18+
local -i run_id
19+
run_id="$(github::runs \
20+
| jq -r '.workflow_runs[] | "\(.id) [\(.conclusion)]: \(.display_title)"' \
21+
| fzf --header="Select a run to download artifacts from" \
22+
| awk '{print $1}')"
23+
24+
# Choose artifact to download
25+
local artifact
26+
artifact="$(github::artifacts ${run_id} \
27+
| jq -r '.artifacts[] | "\(.id) \(.name)"' \
28+
| fzf --header="Select an artifact to download")"
29+
30+
echo "Downloading artifact"
31+
mkdir -p dist
32+
github::download "$(awk '{print $1}' <<< "${artifact}")" "dist/$(awk '{print $2}' <<< "${artifact}")"
33+
34+
local release_id
35+
release_id="$(github::releases "/tags/${tag}" | jq -r '.id')"
36+
37+
echo "Uploading assets to release ${tag} (${release_id})"
38+
github::upload_assets "${release_id}"
1139
}

β€Ž.gitignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.idea
33
/CHANGES.md
44
/coverage
5+
/dist

β€ŽBeefileβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ bee::secrets() {
99
}
1010

1111
GITHUB_REPO="sschmid/pw-terminal-password-manager"
12+
GITHUB_ASSETS_ZIP=("dist/pw.zip")
1213
CHANGELOG_URL="https://github.com/${GITHUB_REPO}"

β€ŽBeefile.lockβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
β”œβ”€β”€ gh:local
12
└── release:local
23
β”œβ”€β”€ changelog:3.1.0
34
β”‚ └── semver:2.0.1
4-
└── github:2.0.0
5+
└── github:2.1.0
56
└── semver:2.0.1

0 commit comments

Comments
Β (0)