Skip to content

Merge pull request #209 from markusfi/main #25

Merge pull request #209 from markusfi/main

Merge pull request #209 from markusfi/main #25

name: Create release
on:
push:
branches: [main]
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: macos-latest
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: 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: RxRealm ${{ 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: ./RxRealm.xcframework.zip
asset_name: RxRealm.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 }}