-
Notifications
You must be signed in to change notification settings - Fork 39
114 lines (98 loc) · 3.84 KB
/
publish-new-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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Publish new github release
on:
pull_request:
branches:
- master
types:
- closed
jobs:
release:
name: Publish new release
runs-on: ubuntu-latest
if: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true # only merged pull requests must trigger this job
steps:
- name: Extract version from branch name (for release branches)
id: extract-version
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix-}
VERSION=${VERSION#release/}
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout source branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Node 16
uses: actions/setup-node@v4
with:
node-version: 16
# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email [email protected]
- name: Create Github Release
id: create_release
env:
HUSKY: 0
GITHUB_TOKEN: ${{ secrets.PAT }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.PAT }}
run: |
DEBUG=conventional-github-releaser npx conventional-github-releaser -p angular --config github-release.config.js
- name: Create pull request into develop
uses: repo-sync/pull-request@v2
with:
source_branch: "master"
destination_branch: "develop"
github_token: ${{ secrets.PAT }}
pr_title: "chore(release): pulling master into develop post release v${{ steps.extract-version.outputs.release_version }}"
pr_body: ":crown: *An automated PR*"
pr_reviewer: "@rudderlabs/sdk-ios"
- name: Delete hotfix release branch
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'hotfix-release/')
with:
branches: "hotfix-release/*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete release branch
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'release/')
with:
branches: "release/*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xcframework:
name: Generate and Upload XCFramework
runs-on: macos-latest
needs: release
steps:
- name: Extract version from branch name (for release branches)
id: extract-version
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix-}
VERSION=${VERSION#release/}
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout source branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install xcpretty
run: gem install xcpretty
- name: Install Cocoapods
run: gem install cocoapods
- name: Pod install
run: pod install --repo-update
- name: Generate XCFramework
run: |
sh ./scripts/generate-xcframework.sh
- name: Upload Release Artifact
run: |
zip -r Rudder-xcframeworks.zip xcframeworks
shasum -a 256 Rudder-xcframeworks.zip >Rudder-xcframeworks.sha256
gh release upload v${{ steps.extract-version.outputs.release_version }} Rudder-xcframeworks.zip
gh release upload v${{ steps.extract-version.outputs.release_version }} Rudder-xcframeworks.sha256
env:
GH_TOKEN: ${{ secrets.PAT }}