forked from segmentio/analytics-swift
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (52 loc) · 1.93 KB
/
create-release.yml
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
name: Cocoapods Release workflow
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to create and deploy'
required: true
permissions:
contents: write
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: Install CocoaPods
run: gem install cocoapods
- name: Get current version
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Create GitHub Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: ${{ github.event.inputs.tag }}
draft: false
prerelease: false
body: |
Changes since [${{ steps.previoustag.outputs.tag }}](https://github.com/${{ github.repository }}/compare/${{ steps.previoustag.outputs.tag }}...${{ github.event.inputs.tag }})
- name: Manually update version and tag in podspec
run: |
sed -i.bak 's/\(version = \)"[^"]*"/\1"${{ github.event.inputs.tag }}"/' AnalyticsSwiftCIO.podspec
rm AnalyticsSwiftCIO.podspec.bak
- name: Commit and push podspec
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Bump podspec version to ${{ github.event.inputs.tag }}"
file_pattern: AnalyticsSwiftCIO.podspec
- name: Deploy to cocoapoads
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push AnalyticsSwiftCIO.podspec --allow-warnings