Skip to content

Commit 3e90aad

Browse files
authored
Merge pull request #389 from pusher/PS-140-set-version
Set automatically a new release version using Github Actions
2 parents 5698844 + fffd6a5 commit 3e90aad

File tree

7 files changed

+57
-6
lines changed

7 files changed

+57
-6
lines changed

.github/workflows/prepare.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Prepare release
2+
3+
on:
4+
pull_request:
5+
types: [ labeled ]
6+
branches:
7+
- master
8+
9+
jobs:
10+
prepare-release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Fetch the lastest release version
18+
id: fetch_latest_release
19+
uses: pozetroninc/github-action-get-latest-release@master
20+
with:
21+
repository: ${{ github.repository }}
22+
excludes: prerelease, draft
23+
- uses: actions/checkout@v2
24+
with:
25+
repository: pusher/actions
26+
token: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }}
27+
path: .github/actions
28+
- uses: ./.github/actions/prepare-version-bump
29+
id: bump
30+
with:
31+
current_version: ${{ steps.fetch_latest_release.outputs.release }}
32+
- uses: actions/setup-node@v3
33+
with:
34+
node-version: 16.x
35+
- name: "Bump podspec versions"
36+
shell: bash
37+
run: |
38+
npm install --location=global podspec-bump
39+
40+
sed -i 's/${{ steps.bump.outputs.current_version }}/${{ steps.bump.outputs.new_version }}/1' Tests/Integration/PusherClientInitializationTests.swift
41+
sed -i 's/${{ steps.bump.outputs.current_version }}/${{ steps.bump.outputs.new_version }}/1' Tests/Info.plist
42+
sed -i 's/${{ steps.bump.outputs.current_version }}/${{ steps.bump.outputs.new_version }}/1' Sources/PusherSwift.swift
43+
sed -i 's/${{ steps.bump.outputs.current_version }}/${{ steps.bump.outputs.new_version }}/1' Sources/Info.plist
44+
45+
podspec-bump -i ${{ steps.bump.outputs.new_version }} -w -p PusherSwift.podspec
46+
podspec-bump -i ${{ steps.bump.outputs.new_version }} -w -p PusherSwiftWithEncryption.podspec
47+
48+
git add Tests/Integration/PusherClientInitializationTests.swift Tests/Info.plist Sources/PusherSwift.swift Sources/Info.plist PusherSwift.podspec PusherSwiftWithEncryption.podspec
49+
50+
git commit -m "Bump to version ${{ steps.bump.outputs.new_version }}"
51+
git push

PusherSwift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'PusherSwift'
3-
s.version = '10.1.0'
3+
s.version = '10.1.1'
44
s.summary = 'A Pusher client library in Swift'
55
s.homepage = 'https://github.com/pusher/pusher-websocket-swift'
66
s.license = 'MIT'

PusherSwiftWithEncryption.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'PusherSwiftWithEncryption'
3-
s.version = '10.1.0'
3+
s.version = '10.1.1'
44
s.summary = 'A Pusher client library in Swift that supports encrypted channels'
55
s.homepage = 'https://github.com/pusher/pusher-websocket-swift'
66
s.license = 'MIT'

Sources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>10.1.0</string>
18+
<string>10.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Sources/PusherSwift.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import NWWebSocket
33

44
let PROTOCOL = 7
5-
let VERSION = "10.1.0"
5+
let VERSION = "10.1.1"
66
// swiftlint:disable:next identifier_name
77
let CLIENT_NAME = "pusher-websocket-swift"
88

Tests/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>10.1.0</string>
18+
<string>10.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Tests/Integration/PusherClientInitializationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import XCTest
22

33
@testable import PusherSwift
44

5-
let VERSION = "10.1.0"
5+
let VERSION = "10.1.1"
66

77
class ClientInitializationTests: XCTestCase {
88
private var key: String!

0 commit comments

Comments
 (0)