From 4f96dc3b28e66f27ee6cef117948024a568cbfd8 Mon Sep 17 00:00:00 2001 From: Fumito Ito Date: Sun, 27 Oct 2024 00:45:39 +0900 Subject: [PATCH 1/3] automate release for cocoapods via github actions --- .github/workflows/publish-to-cocoapods.yml | 26 ++++++++++++++++++++++ GRMustache.swift.podspec | 5 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-to-cocoapods.yml diff --git a/.github/workflows/publish-to-cocoapods.yml b/.github/workflows/publish-to-cocoapods.yml new file mode 100644 index 0000000..e061744 --- /dev/null +++ b/.github/workflows/publish-to-cocoapods.yml @@ -0,0 +1,26 @@ +name: publish-to-cocoapods + +on: + release: + types: [published] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Install Cocoapods + run: gem install cocoapods + + - name: Publish to Cocoapods registry + run: | + set -eo pipefail + pod lib lint --allow-warnings + pod trunk push --allow-warnings + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + RELEASE_VERSION: ${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/GRMustache.swift.podspec b/GRMustache.swift.podspec index 0a37c2f..a90b81a 100644 --- a/GRMustache.swift.podspec +++ b/GRMustache.swift.podspec @@ -1,6 +1,9 @@ +version = ENV["RELEASE_VERSION"] +exit 1 if version.to_s.empty? + Pod::Spec.new do |s| s.name = 'GRMustache.swift' - s.version = '5.0.1' + s.version = version s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'Flexible Mustache templates for Swift.' s.homepage = 'https://github.com/groue/GRMustache.swift' From 050bee89c89fb6f659dcf50f45c380e95e700e38 Mon Sep 17 00:00:00 2001 From: Fumito Ito Date: Sun, 27 Oct 2024 21:35:04 +0900 Subject: [PATCH 2/3] fix invalid version handling --- .github/workflows/publish-to-cocoapods.yml | 1 - GRMustache.swift.podspec | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/publish-to-cocoapods.yml b/.github/workflows/publish-to-cocoapods.yml index e061744..81bcd9e 100644 --- a/.github/workflows/publish-to-cocoapods.yml +++ b/.github/workflows/publish-to-cocoapods.yml @@ -23,4 +23,3 @@ jobs: pod trunk push --allow-warnings env: COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} - RELEASE_VERSION: ${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/GRMustache.swift.podspec b/GRMustache.swift.podspec index a90b81a..9c257a1 100644 --- a/GRMustache.swift.podspec +++ b/GRMustache.swift.podspec @@ -1,9 +1,6 @@ -version = ENV["RELEASE_VERSION"] -exit 1 if version.to_s.empty? - Pod::Spec.new do |s| s.name = 'GRMustache.swift' - s.version = version + s.version = 5.0.1 s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'Flexible Mustache templates for Swift.' s.homepage = 'https://github.com/groue/GRMustache.swift' From 8c5d64c042f006ec2beb418075a34d5da6779610 Mon Sep 17 00:00:00 2001 From: Fumito Ito Date: Sun, 27 Oct 2024 21:35:59 +0900 Subject: [PATCH 3/3] fix nits --- GRMustache.swift.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GRMustache.swift.podspec b/GRMustache.swift.podspec index 9c257a1..0a37c2f 100644 --- a/GRMustache.swift.podspec +++ b/GRMustache.swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GRMustache.swift' - s.version = 5.0.1 + s.version = '5.0.1' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'Flexible Mustache templates for Swift.' s.homepage = 'https://github.com/groue/GRMustache.swift'