Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release
'on':
workflow_dispatch:
inputs:
bump:
description: Version bump
required: true
type: choice
default: patch
options:
- patch
- minor
- major
permissions: {}
concurrency: release-${{ github.repository }}
jobs:
release:
name: Release
uses: nicodes/tools/.github/workflows/cli-release.yml@0276991861118d6e70a92cd11432dd664d3b030f
permissions:
contents: write
attestations: write
id-token: write
with:
tools-ref: '0276991861118d6e70a92cd11432dd664d3b030f'
bump: ${{ inputs.bump }}
binary: spritesmith
prepared-assets: dist
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ spritesmith.png
.komizo.mise*.toml

.komizo.mise*.lock
/release-assets/
3 changes: 2 additions & 1 deletion komizo.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
"workflow": {
"required": [
"ci.yml",
"dependency-policy.yml"
"dependency-policy.yml",
"release.yml"
],
"ci_gates": [
"Test"
Expand Down
2 changes: 1 addition & 1 deletion komizo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 1,
"platform": "0.2.4",
"platform_revision": "40086036977a5fc0119d6c4c1d5eb6ae3ab3b4b9",
"manifest_sha256": "653c90b64c1e3ab61144487592183467b11f89192d79669ad16a0117997badd1",
"manifest_sha256": "923459892302e4bfad0c8d55fbe18dd969504460eecf118a97a2949d9e3983e4",
"runtime_sha256": "000c1991c455b7e1269646e40c05ebf4a1b0717197c34838d2b7669430b3e862",
"recipe_sha256": "54409e9d09752cdb8031115189632766982b31684cf9acab607b297461b93156"
}
9 changes: 8 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64; d
CGO_ENABLED=0 GOOS="$target_os" GOARCH="$target_arch" go build -trimpath \
-ldflags "-X main.version=$VERSION -X main.revision=$revision" -o "$staging/$binary" ./cmd/spritesmith
cp README.md "$staging/README.md"
archive="spritesmith_${target_os}_${target_arch}"
case "$target_os" in
linux) os_label=Linux ;;
darwin) os_label=Darwin ;;
windows) os_label=Windows ;;
esac
arch_label="$target_arch"
[[ "$target_arch" != amd64 ]] || arch_label=x86_64
archive="spritesmith_${os_label}_${arch_label}"
if [[ "$target_os" == windows ]]; then
python3 - "$staging" "dist/$archive.zip" <<'PY'
from pathlib import Path
Expand Down
6 changes: 3 additions & 3 deletions scripts/check-artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

root = Path('dist')
expected = {f'spritesmith_{os}_{arch}.{suffix}' for os, arch, suffix in (
('linux', 'amd64', 'tar.gz'), ('linux', 'arm64', 'tar.gz'),
('darwin', 'amd64', 'tar.gz'), ('darwin', 'arm64', 'tar.gz'), ('windows', 'amd64', 'zip'))}
('Linux', 'x86_64', 'tar.gz'), ('Linux', 'arm64', 'tar.gz'),
('Darwin', 'x86_64', 'tar.gz'), ('Darwin', 'arm64', 'tar.gz'), ('Windows', 'x86_64', 'zip'))}
checksums = {}
for line in (root/'checksums.txt').read_text().splitlines():
digest, name = line.split()
Expand All @@ -35,7 +35,7 @@
release = json.loads((root/'release.json').read_text())
if release['revision'] != revision: raise SystemExit('artifacts belong to another source revision')
with tempfile.TemporaryDirectory() as temp:
with tarfile.open(root/'spritesmith_linux_amd64.tar.gz') as archive:
with tarfile.open(root/'spritesmith_Linux_x86_64.tar.gz') as archive:
archive.extractall(temp, filter='data')
output = subprocess.check_output([str(Path(temp)/'spritesmith'), '--version'], text=True)
if revision not in output: raise SystemExit('binary revision differs')
Expand Down