-
Notifications
You must be signed in to change notification settings - Fork 6
44 lines (36 loc) · 1.25 KB
/
ensure-podspec-version.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
name: Update Podspec Version
on:
release:
types: [published]
workflow_dispatch:
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create new branch
run: |
git checkout -b update-version-${{ github.event.release.tag_name }}
- name: Update version
run: |
VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-) # remove the v from the tag name
sed -i 's/\(s.version\s*=\s*\).*$/\1'"\"$VERSION\""'/g' Fula.podspec
sed -i 's/#{s.version}/'"$VERSION"'/g' Fula.podspec
- name: Set up Git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Commit and push
run: |
git add .
git commit -m "Update version to $VERSION"
git push origin update-version-${{ github.event.release.tag_name }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: 'Update version to ${{ env.VERSION }}'
body: 'Automatically update version number.'
labels: 'version update, automated pr'
branch: 'update-version-${{ github.event.release.tag_name }}'
draft: false