This repository was archived by the owner on Oct 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
100 lines (83 loc) · 2.67 KB
/
deploy-swift.yml
File metadata and controls
100 lines (83 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Release Swift Package
on:
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., 1.2.3 or major/minor/patch)"
required: true
type: string
permissions:
contents: write
jobs:
release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode.app
- name: Determine version
id: set_version
shell: bash
run: |
VERSION="${{ github.event.inputs.version }}"
# Trim possible leading 'v'
VERSION="${VERSION#v}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Release version: $VERSION"
- name: Configure Git
run: |
git config user.name "hyodotdev"
git config user.email "hyo@hyo.dev"
- name: Install jq (for JSON processing)
run: |
if ! command -v jq &> /dev/null; then
brew install jq
fi
- name: Bump version and tag
run: |
./scripts/bump-version.sh "${{ env.VERSION }}"
# Refresh VERSION to the computed value (handles major/minor/patch)
NEW_VERSION=$(jq -r '.apple' openiap-versions.json)
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
echo "Computed version: $NEW_VERSION"
- name: Build Package
run: swift build
- name: Run Tests
run: swift test
- name: Verify Package
run: |
swift package show-dependencies
swift package describe
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Install CocoaPods
run: |
gem list -i cocoapods || gem install cocoapods --no-document
- name: Validate Podspec
env:
COCOAPODS_VALIDATOR_SKIP_XCODEBUILD: 1
run: |
pod lib lint openiap.podspec --allow-warnings
- name: Publish to CocoaPods Trunk
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_VALIDATOR_SKIP_XCODEBUILD: 1
run: |
if [ -z "$COCOAPODS_TRUNK_TOKEN" ]; then
echo "COCOAPODS_TRUNK_TOKEN is not set. Skipping CocoaPods publish.";
exit 0;
fi
pod trunk push openiap.podspec --allow-warnings