-
Notifications
You must be signed in to change notification settings - Fork 93
86 lines (73 loc) · 2.36 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Create release
on:
push:
branches: [main]
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: macos-11.0
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Bump version
run: |
chmod +x ./scripts/bump-version.sh
./scripts/bump-version.sh
# - name: Changelog
# uses: scottbrenner/generate-changelog-action@master
# id: Changelog
# env:
# REPO: ${{ github.repository }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Restore SPM Cache
uses: actions/cache@v1
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Resolve dependencies
run: |
brew bundle
bundle
- name: Release XCFrameworks
run: |
chmod +x ./scripts/xcframeworks.sh
./scripts/xcframeworks.sh
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: RxOptional ${{ env.RELEASE_VERSION }}
# body: |
# ${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Upload XCFramework
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./RxOptional.xcframework.zip
asset_name: RxOptional.xcframework.zip
asset_content_type: application/zip
- name: Deploy to Cocoapods
run: |
set -eo pipefail
export RELEASE_VERSION="$(git describe --abbrev=0 | tr -d '\n')"
RELEASE_VERSION=${RELEASE_VERSION:1}
pod lib lint --allow-warnings
pod trunk push --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}