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
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Generate documentation
run: ./scripts/gen_docs.sh docc-site

- name: Setup Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@v6

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: docc-site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
46 changes: 10 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
- .github/workflows/**
- .swift-format
- Package.swift
- Punycode.podspec
- Punycode.xcodeproj/**
- Sources/**
- Tests/**
Expand All @@ -27,7 +26,6 @@ on:
env:
project_name: Punycode
scheme: Punycode
podspec_name: Punycode

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -39,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0 # Full git history is needed to get a proper list of changed files
- name: Lint
Expand All @@ -65,13 +63,13 @@ jobs:
name: "Test: macOS 15, Xcode 16.4"
coverage: NO
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: ${{ matrix.name }}
run: |-
set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${{ env.project_name }}.xcodeproj" -scheme ${{ env.scheme }} -destination "platform=macOS" -enableCodeCoverage ${{ matrix.coverage }} clean test | xcbeautify --renderer github-actions
- name: Upload coverage to Codecov
if: ${{ matrix.coverage == 'YES' }}
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
Expand All @@ -83,7 +81,7 @@ jobs:
runs-on: macos-26
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Catalyst
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${{ env.project_name }}.xcodeproj" -scheme ${{ env.scheme }} -destination "platform=macOS,variant=Mac Catalyst" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO clean test 2>&1 | xcbeautify --renderer github-actions
needs: lint_code
Expand Down Expand Up @@ -134,7 +132,7 @@ jobs:
runsOn: macos-26
name: "Test: visionOS, Xcode 26"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: ${{ matrix.name }}
run: |
set -o pipefail
Expand Down Expand Up @@ -163,7 +161,7 @@ jobs:
- runsOn: macos-15
name: "SPM: macOS 15, Xcode 16.4"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Test SPM
run: swift test -c debug 2>&1 | xcbeautify --renderer github-actions
needs: [test_macOS, test_Catalyst, test_simulators]
Expand All @@ -174,47 +172,23 @@ jobs:
timeout-minutes: 10
container: swift:6.2
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Test SPM
run: swift test -c debug
needs: [test_macOS, test_Catalyst, test_simulators]

### Carthage builds are no longer verified by CI (Carthage is in maintenance mode;
### compatibility is kept on a best-effort basis via the Xcode project).
### CocoaPods linting is reduced to macOS/iOS Release: the trunk becomes read-only
### on 2026-12-02 and this job will be removed after that date.
lint_cocoapods:
name: "Pods: ${{ matrix.platform }}, ${{ matrix.configuration }}"
runs-on: macos-26
strategy:
fail-fast: true
matrix:
platform: [macos, ios]
configuration: [Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pod lib lint
run: |
pod lib lint --verbose \
--configuration=${{ matrix.configuration }} \
--platforms=${{ matrix.platform }} \
${{ env.podspec_name }}.podspec
- name: Pod lib lint - Use Static Frameworks
run: |
pod lib lint --verbose --use-static-frameworks \
--configuration=${{ matrix.configuration }} \
--platforms=${{ matrix.platform }} \
${{ env.podspec_name }}.podspec
needs: SPM
### CocoaPods distribution ended with 4.0.0 (the trunk becomes read-only on
### 2026-12-02); 3.0.0 is the last version published as a pod.

### Aggregate gate used as the sole required status check on main.
### Matrix job names change with Xcode versions; this name must stay stable.
ci_success:
name: CI Success
runs-on: ubuntu-latest
if: always()
needs: [lint_code, test_macOS, test_Catalyst, test_simulators, SPM, SPM_linux, lint_cocoapods]
needs: [lint_code, test_macOS, test_Catalyst, test_simulators, SPM, SPM_linux]
steps:
- name: Check all jobs succeeded
run: |
Expand Down
28 changes: 3 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Publishes the library when a version tag is pushed: creates a GitHub Release
# and pushes to CocoaPods trunk.
# Publishes the library when a version tag is pushed: creates a GitHub Release.
# Tags are immutable: pushing a tag for a version that is already published fails
# instead of replacing the existing release. Bump the version and tag again instead.

Expand All @@ -12,15 +11,14 @@ on:

env:
project_name: Punycode
podspec_name: Punycode

jobs:
verify:
name: Verify tag matches project version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Verify tag matches project version
run: |
Expand All @@ -40,7 +38,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Extract release notes from CHANGELOG.md
run: |
Expand All @@ -64,23 +62,3 @@ jobs:
echo "No CHANGELOG section for ${GITHUB_REF_NAME}; falling back to generated notes."
gh release create "${GITHUB_REF_NAME}" --title "${GITHUB_REF_NAME}" --generate-notes --verify-tag
fi

publish_cocoapods:
name: Publish to CocoaPods
runs-on: macos-latest
needs: verify
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish to CocoaPods trunk
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
set -eo pipefail
### Never republish an existing version; released versions are immutable.
if pod trunk info ${{ env.podspec_name }} | grep -q "${GITHUB_REF_NAME}"; then
echo "Error: Version ${GITHUB_REF_NAME} already exists on CocoaPods trunk. Bump the version instead of republishing."
exit 1
fi
pod trunk push ${{ env.podspec_name }}.podspec --allow-warnings
5 changes: 1 addition & 4 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ python = "3.11.9"
ruby = "3.4.10"

[env]
_.python.venv = ".venv"
EXPANDED_CODE_SIGN_IDENTITY=""
EXPANDED_CODE_SIGN_IDENTITY_NAME=""
EXPANDED_PROVISIONING_PROFILE=""
_.python.venv = ".venv"
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- CocoaPods publishing: 3.0.0 is the last version available as the `Punycode` pod. 4.0.0 and later are distributed via Swift Package Manager (and Carthage on a best-effort basis). The podspec, the pod lint CI job, and the trunk push in the release workflow are removed.

## [4.0.0] - 2026-08-18

### Added
Expand Down Expand Up @@ -82,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release: Punycode (RFC 3492) encode/decode and IDNA encode/decode via `String` / `Substring` extensions.

[Unreleased]: https://github.com/futamura/PunycodeSwift/compare/4.0.0...HEAD
[4.0.0]: https://github.com/futamura/PunycodeSwift/compare/3.0.0...4.0.0
[3.0.0]: https://github.com/futamura/PunycodeSwift/compare/2.1.1...3.0.0
[2.1.1]: https://github.com/futamura/PunycodeSwift/compare/2.1.0...2.1.1
Expand Down
16 changes: 7 additions & 9 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Overview

PunycodeSwift — a pure Swift library (no dependencies) that encodes/decodes Punycode (RFC 3492) and IDNA hostnames via `String` / `Substring` extensions. Runs on all Apple platforms and Linux. Distributed primarily via SPM. Carthage compatibility is best-effort (not CI-verified); CocoaPods distribution (pod name: `Punycode`) ends when the trunk becomes read-only on 2026-12-02.
PunycodeSwift — a pure Swift library (no dependencies) that encodes/decodes Punycode (RFC 3492) and IDNA hostnames via `String` / `Substring` extensions. Runs on all Apple platforms and Linux. Distributed via SPM. Carthage compatibility is best-effort (not CI-verified); CocoaPods distribution has ended (3.0.0 is the last version published under the pod name `Punycode`).

## Commands

Expand All @@ -24,10 +24,9 @@ bundle exec fastlane tests # xcodebuild tests on all platforms (macOS
bundle exec fastlane lint_swift # swift-format lint
bundle exec fastlane build_spm # swift build + test
bundle exec fastlane build_carthage # Carthage builds per platform
bundle exec fastlane lint_cocoapods # pod lib lint
bundle exec fastlane gen_docs # DocC static site into docc-site/ (via scripts/gen_docs.sh)
bundle exec fastlane set_version # prompt for version; syncs pbxproj + podspec
bundle exec fastlane bump_version # patch/minor/major bump; same sync
bundle exec fastlane set_version # prompt for version; sets MARKETING_VERSION in the pbxproj
bundle exec fastlane bump_version # patch/minor/major bump; same effect

# Interactive job menu (fzf)
./run.sh
Expand All @@ -51,11 +50,10 @@ Tests live in `Tests/PunycodeTests.swift` (single XCTest file; SPM test target n

## Versioning and release

- Single source of truth for the version: `MARKETING_VERSION` in `Punycode.xcodeproj/project.pbxproj`. Fastlane and CI both read it. Never edit versions by hand — use `fastlane set_version` / `bump_version`, which also sync `Punycode.podspec`.
- Single source of truth for the version: `MARKETING_VERSION` in `Punycode.xcodeproj/project.pbxproj`. Fastlane and CI both read it. Never edit versions by hand — use `fastlane set_version` / `bump_version`.
- Branch flow: work on `develop`, PR into `main`.
- CI (`.github/workflows/main.yml`) runs on push and pull request to `main`/`develop`: lint → per-platform xcodebuild tests (simulator devices resolved at runtime via `simctl`) → SPM (macOS + Linux via the official Swift container) → pod lib lint. It does not release. Carthage builds are not CI-verified.
- CI (`.github/workflows/main.yml`) runs on push and pull request to `main`/`develop`: lint → per-platform xcodebuild tests (simulator devices resolved at runtime via `simctl`) → SPM (macOS + Linux via the official Swift container). It does not release. Carthage builds are not CI-verified.
- Documentation (`.github/workflows/docs.yml`) builds the DocC site with `scripts/gen_docs.sh` (symbolgraph-extract with `-emit-extension-block-symbols` — required because the whole public API is extensions on String/Substring — then `docc convert`) and deploys it to GitHub Pages on every push to `main`. The site is not tracked in git; `docs/` no longer exists.
- After 2026-12-02 (CocoaPods trunk read-only): remove the `lint_cocoapods` job from `main.yml` and the pod push from `release.yml`.
- Releasing is a separate, explicit step: push a bare version tag (e.g. `3.0.1`) matching `MARKETING_VERSION`. `.github/workflows/release.yml` then verifies the tag against the project version, creates a GitHub Release (notes taken from the tag's `CHANGELOG.md` section, falling back to generated notes), and pushes to CocoaPods trunk. Use `./run.sh` → "Github - Update tag" to create the tag.
- Version tags are immutable: both the release workflow and `run.sh` fail if the tag or trunk version already exists. To re-release, bump the version — never delete/re-push a tag.
- Releasing is a separate, explicit step: push a bare version tag (e.g. `4.0.1`) matching `MARKETING_VERSION`. `.github/workflows/release.yml` then verifies the tag against the project version and creates a GitHub Release (notes taken from the tag's `CHANGELOG.md` section, falling back to generated notes). Use `./run.sh` → "Github - Update tag" to create the tag.
- Version tags are immutable: both the release workflow and `run.sh` fail if the tag already exists. To re-release, bump the version — never delete/re-push a tag.
- Keep `CHANGELOG.md` (Keep a Changelog format) current: user-facing changes go under **Unreleased**; when releasing, rename that section to the new version with the date and add its compare link. The release workflow extracts this section for the GitHub Release notes.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Run this before pushing; the `Lint Code` job fails on violations.

## Versioning and releases

Releases are handled by maintainers. The version's single source of truth is `MARKETING_VERSION` in `Punycode.xcodeproj/project.pbxproj`; it is synced to the podspec and docs via `bundle exec fastlane set_version` / `bump_version`. Do not edit version numbers by hand in a pull request.
Releases are handled by maintainers. The version's single source of truth is `MARKETING_VERSION` in `Punycode.xcodeproj/project.pbxproj`; set it via `bundle exec fastlane set_version` / `bump_version`. Do not edit version numbers by hand in a pull request.

## Reporting issues

Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "cocoapods"
gem "cocoapods-deintegrate"
gem "cocoapods-clean"
gem "fastlane"
gem "slather"
gem "xcpretty"
Expand Down
Loading
Loading