Skip to content

Commit 7052a97

Browse files
author
Clemens Vasters
committed
fix(ci): update macos-13 to macos-15 (Intel runner retired)
1 parent c5517ed commit 7052a97

File tree

5 files changed

+456
-1
lines changed

5 files changed

+456
-1
lines changed

.github/workflows/jstruct-cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
os: windows-latest
137137
artifact: jstruct.exe
138138
- target: x86_64-apple-darwin
139-
os: macos-13
139+
os: macos-15
140140
artifact: jstruct
141141
- target: aarch64-apple-darwin
142142
os: macos-latest

assets/tag-release.ps1

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<#
2+
.SYNOPSIS
3+
Tags a new version release for the JSON Structure SDK.
4+
5+
.DESCRIPTION
6+
Creates all required Git tags for a release:
7+
- v{VERSION} - Main version tag (triggers SDK CI workflows)
8+
- go/v{VERSION} - Go module tag (required for Go package discovery)
9+
- jstruct-v{VERSION} - CLI release tag (triggers CLI build and GitHub Release)
10+
11+
.PARAMETER Version
12+
The version number to tag (e.g., "0.5.4"). Do not include the "v" prefix.
13+
14+
.PARAMETER Push
15+
If specified, pushes the tags to origin after creation.
16+
17+
.PARAMETER CliOnly
18+
If specified, only creates the jstruct-v{VERSION} tag (for CLI-only releases).
19+
20+
.EXAMPLE
21+
.\tag-release.ps1 -Version 0.5.4
22+
Creates tags locally: v0.5.4, go/v0.5.4, jstruct-v0.5.4
23+
24+
.EXAMPLE
25+
.\tag-release.ps1 -Version 0.5.4 -Push
26+
Creates and pushes all tags to origin.
27+
28+
.EXAMPLE
29+
.\tag-release.ps1 -Version 0.5.4 -CliOnly -Push
30+
Creates and pushes only the CLI tag (jstruct-v0.5.4).
31+
#>
32+
33+
param(
34+
[Parameter(Mandatory=$true)]
35+
[ValidatePattern('^\d+\.\d+\.\d+$')]
36+
[string]$Version,
37+
38+
[switch]$Push,
39+
40+
[switch]$CliOnly
41+
)
42+
43+
$ErrorActionPreference = 'Stop'
44+
45+
# Validate we're in a git repository
46+
if (-not (Test-Path .git)) {
47+
Write-Error "Not in a git repository root. Please run from the SDK repository root."
48+
exit 1
49+
}
50+
51+
# Check for uncommitted changes
52+
$status = git status --porcelain
53+
if ($status) {
54+
Write-Warning "You have uncommitted changes:"
55+
$status | ForEach-Object { Write-Host " $_" -ForegroundColor Yellow }
56+
$confirm = Read-Host "Continue anyway? (y/N)"
57+
if ($confirm -ne 'y' -and $confirm -ne 'Y') {
58+
Write-Host "Aborted." -ForegroundColor Red
59+
exit 1
60+
}
61+
}
62+
63+
# Define tags to create
64+
if ($CliOnly) {
65+
$tags = @(
66+
"jstruct-v$Version"
67+
)
68+
} else {
69+
$tags = @(
70+
"v$Version",
71+
"go/v$Version",
72+
"jstruct-v$Version"
73+
)
74+
}
75+
76+
Write-Host "`nTags to create:" -ForegroundColor Cyan
77+
$tags | ForEach-Object { Write-Host " - $_" -ForegroundColor White }
78+
79+
# Check if tags already exist
80+
$existingTags = @()
81+
foreach ($tag in $tags) {
82+
$exists = git tag -l $tag
83+
if ($exists) {
84+
$existingTags += $tag
85+
}
86+
}
87+
88+
if ($existingTags.Count -gt 0) {
89+
Write-Warning "The following tags already exist:"
90+
$existingTags | ForEach-Object { Write-Host " - $_" -ForegroundColor Yellow }
91+
$confirm = Read-Host "Delete and recreate them? (y/N)"
92+
if ($confirm -ne 'y' -and $confirm -ne 'Y') {
93+
Write-Host "Aborted." -ForegroundColor Red
94+
exit 1
95+
}
96+
97+
# Delete existing tags locally
98+
foreach ($tag in $existingTags) {
99+
Write-Host "Deleting local tag: $tag" -ForegroundColor Yellow
100+
git tag -d $tag
101+
}
102+
103+
# Delete from remote if pushing
104+
if ($Push) {
105+
foreach ($tag in $existingTags) {
106+
Write-Host "Deleting remote tag: $tag" -ForegroundColor Yellow
107+
git push origin ":refs/tags/$tag" 2>$null
108+
}
109+
}
110+
}
111+
112+
# Create tags
113+
Write-Host "`nCreating tags..." -ForegroundColor Cyan
114+
foreach ($tag in $tags) {
115+
Write-Host " Creating: $tag" -ForegroundColor Green
116+
git tag $tag
117+
}
118+
119+
# Push tags if requested
120+
if ($Push) {
121+
Write-Host "`nPushing tags to origin..." -ForegroundColor Cyan
122+
foreach ($tag in $tags) {
123+
Write-Host " Pushing: $tag" -ForegroundColor Green
124+
git push origin $tag
125+
}
126+
127+
Write-Host "`n✓ All tags pushed successfully!" -ForegroundColor Green
128+
Write-Host "`nWorkflows triggered:" -ForegroundColor Cyan
129+
if (-not $CliOnly) {
130+
Write-Host " - SDK workflows (Python, .NET, Java, TypeScript, Go, Rust, etc.)" -ForegroundColor White
131+
}
132+
Write-Host " - CLI release workflow (builds binaries and creates GitHub Release)" -ForegroundColor White
133+
Write-Host "`nMonitor at: https://github.com/json-structure/sdk/actions" -ForegroundColor Blue
134+
} else {
135+
Write-Host "`n✓ Tags created locally." -ForegroundColor Green
136+
Write-Host "Run with -Push to push tags to origin." -ForegroundColor Yellow
137+
}

assets/tag-release.sh

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#!/bin/bash
2+
#
3+
# tag-release.sh - Tags a new version release for the JSON Structure SDK
4+
#
5+
# Creates all required Git tags for a release:
6+
# - v{VERSION} - Main version tag (triggers SDK CI workflows)
7+
# - go/v{VERSION} - Go module tag (required for Go package discovery)
8+
# - jstruct-v{VERSION} - CLI release tag (triggers CLI build and GitHub Release)
9+
#
10+
# Usage:
11+
# ./tag-release.sh 0.5.4 # Create tags locally
12+
# ./tag-release.sh 0.5.4 --push # Create and push tags
13+
# ./tag-release.sh 0.5.4 --cli-only --push # CLI tag only
14+
#
15+
16+
set -e
17+
18+
# Colors
19+
RED='\033[0;31m'
20+
GREEN='\033[0;32m'
21+
YELLOW='\033[1;33m'
22+
CYAN='\033[0;36m'
23+
BLUE='\033[0;34m'
24+
NC='\033[0m' # No Color
25+
26+
# Parse arguments
27+
VERSION=""
28+
PUSH=false
29+
CLI_ONLY=false
30+
31+
while [[ $# -gt 0 ]]; do
32+
case $1 in
33+
--push)
34+
PUSH=true
35+
shift
36+
;;
37+
--cli-only)
38+
CLI_ONLY=true
39+
shift
40+
;;
41+
*)
42+
if [[ -z "$VERSION" ]]; then
43+
VERSION="$1"
44+
else
45+
echo -e "${RED}Unknown argument: $1${NC}"
46+
exit 1
47+
fi
48+
shift
49+
;;
50+
esac
51+
done
52+
53+
# Validate version
54+
if [[ -z "$VERSION" ]]; then
55+
echo "Usage: $0 VERSION [--push] [--cli-only]"
56+
echo ""
57+
echo "Examples:"
58+
echo " $0 0.5.4 # Create tags locally"
59+
echo " $0 0.5.4 --push # Create and push tags"
60+
echo " $0 0.5.4 --cli-only --push # CLI tag only"
61+
exit 1
62+
fi
63+
64+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
65+
echo -e "${RED}Invalid version format. Expected: X.Y.Z (e.g., 0.5.4)${NC}"
66+
exit 1
67+
fi
68+
69+
# Validate we're in a git repository
70+
if [[ ! -d .git ]]; then
71+
echo -e "${RED}Not in a git repository root. Please run from the SDK repository root.${NC}"
72+
exit 1
73+
fi
74+
75+
# Check for uncommitted changes
76+
if [[ -n $(git status --porcelain) ]]; then
77+
echo -e "${YELLOW}Warning: You have uncommitted changes:${NC}"
78+
git status --porcelain | sed 's/^/ /'
79+
read -p "Continue anyway? (y/N) " confirm
80+
if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
81+
echo -e "${RED}Aborted.${NC}"
82+
exit 1
83+
fi
84+
fi
85+
86+
# Define tags to create
87+
if $CLI_ONLY; then
88+
TAGS=("jstruct-v$VERSION")
89+
else
90+
TAGS=("v$VERSION" "go/v$VERSION" "jstruct-v$VERSION")
91+
fi
92+
93+
echo -e "\n${CYAN}Tags to create:${NC}"
94+
for tag in "${TAGS[@]}"; do
95+
echo " - $tag"
96+
done
97+
98+
# Check if tags already exist
99+
EXISTING_TAGS=()
100+
for tag in "${TAGS[@]}"; do
101+
if git tag -l "$tag" | grep -q .; then
102+
EXISTING_TAGS+=("$tag")
103+
fi
104+
done
105+
106+
if [[ ${#EXISTING_TAGS[@]} -gt 0 ]]; then
107+
echo -e "\n${YELLOW}Warning: The following tags already exist:${NC}"
108+
for tag in "${EXISTING_TAGS[@]}"; do
109+
echo " - $tag"
110+
done
111+
read -p "Delete and recreate them? (y/N) " confirm
112+
if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
113+
echo -e "${RED}Aborted.${NC}"
114+
exit 1
115+
fi
116+
117+
# Delete existing tags locally
118+
for tag in "${EXISTING_TAGS[@]}"; do
119+
echo -e "${YELLOW}Deleting local tag: $tag${NC}"
120+
git tag -d "$tag"
121+
done
122+
123+
# Delete from remote if pushing
124+
if $PUSH; then
125+
for tag in "${EXISTING_TAGS[@]}"; do
126+
echo -e "${YELLOW}Deleting remote tag: $tag${NC}"
127+
git push origin ":refs/tags/$tag" 2>/dev/null || true
128+
done
129+
fi
130+
fi
131+
132+
# Create tags
133+
echo -e "\n${CYAN}Creating tags...${NC}"
134+
for tag in "${TAGS[@]}"; do
135+
echo -e " ${GREEN}Creating: $tag${NC}"
136+
git tag "$tag"
137+
done
138+
139+
# Push tags if requested
140+
if $PUSH; then
141+
echo -e "\n${CYAN}Pushing tags to origin...${NC}"
142+
for tag in "${TAGS[@]}"; do
143+
echo -e " ${GREEN}Pushing: $tag${NC}"
144+
git push origin "$tag"
145+
done
146+
147+
echo -e "\n${GREEN}✓ All tags pushed successfully!${NC}"
148+
echo -e "\n${CYAN}Workflows triggered:${NC}"
149+
if ! $CLI_ONLY; then
150+
echo " - SDK workflows (Python, .NET, Java, TypeScript, Go, Rust, etc.)"
151+
fi
152+
echo " - CLI release workflow (builds binaries and creates GitHub Release)"
153+
echo -e "\n${BLUE}Monitor at: https://github.com/json-structure/sdk/actions${NC}"
154+
else
155+
echo -e "\n${GREEN}✓ Tags created locally.${NC}"
156+
echo -e "${YELLOW}Run with --push to push tags to origin.${NC}"
157+
fi

publish-perl.ps1

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Publish Perl SDK to CPAN (v0.5.3)
2+
# This script replicates what the GitHub workflow does
3+
4+
$ErrorActionPreference = "Stop"
5+
6+
# Use Strawberry Perl's gmake
7+
$gmake = "C:\Strawberry\c\bin\gmake.exe"
8+
9+
# Add GnuWin32 tools (gzip, etc.) to PATH
10+
$env:Path += ";C:\Program Files (x86)\GnuWin32\bin"
11+
12+
$Version = "0.5.3"
13+
14+
# Prompt for PAUSE credentials
15+
$PauseUsername = Read-Host "Enter your PAUSE username"
16+
$PausePassword = Read-Host "Enter your PAUSE password" -AsSecureString
17+
$PausePasswordPlain = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
18+
[Runtime.InteropServices.Marshal]::SecureStringToBSTR($PausePassword)
19+
)
20+
21+
Write-Host "`nBuilding Perl distribution for v$Version..." -ForegroundColor Cyan
22+
23+
Push-Location perl
24+
25+
try {
26+
# Update version in all .pm files
27+
Write-Host "Updating version in .pm files..." -ForegroundColor Yellow
28+
Get-ChildItem -Path lib -Recurse -Filter "*.pm" | ForEach-Object {
29+
$content = Get-Content $_.FullName -Raw
30+
$updated = $content -replace "VERSION = '[^']*'", "VERSION = '$Version'"
31+
Set-Content $_.FullName $updated -NoNewline
32+
}
33+
34+
# Build the distribution
35+
Write-Host "Running perl Makefile.PL..." -ForegroundColor Yellow
36+
perl Makefile.PL
37+
if ($LASTEXITCODE -ne 0) { throw "Makefile.PL failed" }
38+
39+
Write-Host "Running gmake..." -ForegroundColor Yellow
40+
& $gmake
41+
if ($LASTEXITCODE -ne 0) { throw "gmake failed" }
42+
43+
Write-Host "Running gmake manifest..." -ForegroundColor Yellow
44+
& $gmake manifest
45+
if ($LASTEXITCODE -ne 0) { throw "gmake manifest failed" }
46+
47+
Write-Host "Running gmake dist..." -ForegroundColor Yellow
48+
& $gmake dist
49+
if ($LASTEXITCODE -ne 0) { throw "gmake dist failed" }
50+
51+
# Find the tarball
52+
$Tarball = Get-ChildItem -Filter "JSON-Structure-*.tar.gz" | Select-Object -First 1
53+
if (-not $Tarball) {
54+
throw "No distribution tarball found"
55+
}
56+
57+
Write-Host "`nBuilt: $($Tarball.Name)" -ForegroundColor Green
58+
59+
# Confirm upload
60+
$Confirm = Read-Host "`nUpload $($Tarball.Name) to CPAN? (y/N)"
61+
if ($Confirm -ne "y" -and $Confirm -ne "Y") {
62+
Write-Host "Aborted." -ForegroundColor Yellow
63+
exit 0
64+
}
65+
66+
# Upload to CPAN
67+
Write-Host "`nUploading to CPAN..." -ForegroundColor Cyan
68+
cpan-upload -u $PauseUsername -p $PausePasswordPlain $Tarball.Name
69+
70+
if ($LASTEXITCODE -eq 0) {
71+
Write-Host "`nSuccessfully uploaded to CPAN!" -ForegroundColor Green
72+
} else {
73+
throw "cpan-upload failed"
74+
}
75+
76+
} finally {
77+
Pop-Location
78+
79+
# Clean up - reset version changes
80+
Write-Host "`nResetting version changes..." -ForegroundColor Yellow
81+
git checkout -- perl/lib/
82+
}
83+
84+
Write-Host "`nDone! The package should appear on CPAN within a few hours." -ForegroundColor Green
85+
Write-Host "You can check status at: https://metacpan.org/author/$($PauseUsername.ToUpper())" -ForegroundColor Cyan

0 commit comments

Comments
 (0)