File tree Expand file tree Collapse file tree 2 files changed +41
-21
lines changed Expand file tree Collapse file tree 2 files changed +41
-21
lines changed Original file line number Diff line number Diff line change 1
1
name : Deployment
2
2
on :
3
3
push :
4
- tags :
5
- - patch
6
- - minor
7
- - major
4
+ tags :
5
+ - patch
6
+ - minor
7
+ - major
8
+ workflow_dispatch :
9
+ inputs :
10
+ release :
11
+ type : choice
12
+ description : Deploy new package release
13
+ options :
14
+ - patch
15
+ - minor
16
+ - major
17
+
8
18
jobs :
9
19
deploy :
10
- runs-on : macos-12
20
+ runs-on : macos-latest
11
21
env :
12
22
GITHUB_ACTION : ${{ github.action_path }}
13
23
GITHUB_PERSONAL_ACCESS_TOKEN : ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
14
24
COCOAPODS_TRUNK_TOKEN : ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
15
25
steps :
16
26
- uses : actions/setup-go@v5
17
27
with :
18
- go-version : ' 1.17'
28
+ go-version : " 1.17"
19
29
- name : Set release type environment
20
30
run : |
21
31
echo "RELEASE_TYPE=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
32
+
33
+ if [[ "$RELEASE_TYPE" != "patch" && "$RELEASE_TYPE" != "minor" && "$RELEASE_TYPE" != "major" ]]; then
34
+ echo "RELEASE_TYPE=${{ github.event.inputs.release }}" >> $GITHUB_ENV
35
+ fi
22
36
- name : Check out polyglot
23
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
37
+ uses : actions/checkout@v4
24
38
with :
25
39
repository : algolia/polyglot
26
40
token : ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
27
41
- name : Install polyglot
28
42
run : |
29
43
make install
30
44
export PATH="$GOPATH/bin:$PATH"
31
- - uses : ruby/setup-ruby@v1
32
- with :
33
- ruby-version : ' 2.7.2'
34
- bundler-cache : true
35
- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
45
+ - uses : actions/checkout@v4
36
46
with :
37
47
fetch-depth : 0
38
-
48
+ - uses : ruby/setup-ruby@v1
39
49
with :
40
- lane : ' deploy '
41
- verbose : ' true'
42
- options : ' { "type": "${{ env.RELEASE_TYPE }}" } '
43
-
50
+ ruby-version : " 2.7.2 "
51
+ bundler-cache : true
52
+ - name : Deploy library release
53
+ run : bundle exec fastlane deploy verbose:true type:${{ env.RELEASE_TYPE }} no_dry_run:true
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ lane :deploy do |options|
48
48
repository_name = "algolia/algoliasearch-client-swift"
49
49
podspec_path = "AlgoliaSearchClient.podspec"
50
50
base_branch = options [ :branch ] || "master"
51
+ no_dry_run = options [ :no_dry_run ] || false
51
52
52
53
# ensure branch and cleaniness locally but not on CI.
53
54
if !ENV [ 'GITHUB_ACTION' ]
@@ -105,10 +106,19 @@ lane :deploy do |options|
105
106
sh ( "git tag -d #{ release_type } ; git push --delete origin #{ release_type } " )
106
107
end
107
108
108
- pod_push (
109
- path : podspec_path ,
110
- allow_warnings : true
111
- )
109
+ if no_dry_run
110
+ pod_push (
111
+ path : podspec_path ,
112
+ allow_warnings : true
113
+ )
114
+ else
115
+ pod_lib_lint (
116
+ podspec : podspec_path ,
117
+ verbose : true ,
118
+ allow_warnings : true
119
+ )
120
+ end
121
+
112
122
end
113
123
114
124
lane :deployBeta do |options |
You can’t perform that action at this time.
0 commit comments