|
| 1 | +name: Create release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + if: "!contains(github.event.head_commit.message, 'skip ci')" |
| 10 | + runs-on: macos-11.0 |
| 11 | + |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + with: |
| 15 | + fetch-depth: 0 |
| 16 | + |
| 17 | + - name: Fetch all tags |
| 18 | + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
| 19 | + |
| 20 | + - name: Bump version |
| 21 | + run: | |
| 22 | + chmod +x ./scripts/bump-version.sh |
| 23 | + ./scripts/bump-version.sh |
| 24 | +
|
| 25 | + # - name: Changelog |
| 26 | + # uses: scottbrenner/generate-changelog-action@master |
| 27 | + # id: Changelog |
| 28 | + # env: |
| 29 | + # REPO: ${{ github.repository }} |
| 30 | + |
| 31 | + - name: Push changes |
| 32 | + uses: ad-m/github-push-action@master |
| 33 | + with: |
| 34 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + branch: ${{ github.ref }} |
| 36 | + |
| 37 | + - name: Restore SPM Cache |
| 38 | + uses: actions/cache@v1 |
| 39 | + with: |
| 40 | + path: .build |
| 41 | + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} |
| 42 | + restore-keys: | |
| 43 | + ${{ runner.os }}-spm- |
| 44 | +
|
| 45 | + - name: Release XCFrameworks |
| 46 | + run: | |
| 47 | + chmod +x ./scripts/xcframeworks.sh |
| 48 | + ./scripts/xcframeworks.sh |
| 49 | +
|
| 50 | + - name: Create Release |
| 51 | + id: create_release |
| 52 | + uses: actions/create-release@v1 |
| 53 | + env: |
| 54 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + with: |
| 56 | + tag_name: ${{ env.RELEASE_VERSION }} |
| 57 | + release_name: RxWebKit ${{ env.RELEASE_VERSION }} |
| 58 | + # body: | |
| 59 | + # ${{ steps.Changelog.outputs.changelog }} |
| 60 | + draft: false |
| 61 | + prerelease: false |
| 62 | + |
| 63 | + - name: Upload XCFramework |
| 64 | + uses: actions/upload-release-asset@v1 |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + with: |
| 68 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 69 | + asset_path: ./RxWebKit.xcframework.zip |
| 70 | + asset_name: RxWebKit.xcframework.zip |
| 71 | + asset_content_type: application/zip |
| 72 | + |
| 73 | + - name: Deploy to Cocoapods |
| 74 | + run: | |
| 75 | + set -eo pipefail |
| 76 | + export RELEASE_VERSION="$(git describe --abbrev=0 | tr -d '\n')" |
| 77 | + RELEASE_VERSION=${RELEASE_VERSION:1} |
| 78 | + pod lib lint --allow-warnings |
| 79 | + pod trunk push --allow-warnings |
| 80 | + env: |
| 81 | + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |
0 commit comments