Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza committed Nov 21, 2021
1 parent ad4856a commit ee5944c
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 35 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,26 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ '**' ]
env:
CI_XCODE_11: '/Applications/Xcode_11.7.app/Contents/Developer'
CI_XCODE_13: '/Applications/Xcode_13.1.app/Contents/Developer'

jobs:
release-dry-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm ci
- run: npx semantic-release
- name: Determine tag for next release
run: echo $(git describe --tags --abbrev=0 --exact-match || echo '')

ios:
runs-on: macos-latest
steps:
Expand All @@ -34,7 +48,6 @@ jobs:
- name: Send codecov
run: bash <(curl https://codecov.io/bash)


macos:
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -152,7 +165,7 @@ jobs:
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

release:
upload-assets:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
name: release
name: release-automated
on:
release:
types: [published]
push:
branches: [ master, release, alpha, beta ]
env:
CI_XCODE_11: '/Applications/Xcode_11.7.app/Contents/Developer'
CI_XCODE_13: '/Applications/Xcode_13.0.app/Contents/Developer'

jobs:
release:
runs-on: ubuntu-latest
outputs:
current_tag: ${{ steps.tag.outputs.current_tag }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm ci
- run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Determine tag on current commit
id: tag
run: echo "::set-output name=current_tag::$(git describe --tags --abbrev=0 --exact-match || echo '')"

cocoapods:
needs: release
if: needs.release.outputs.current_tag != ''
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ needs.release.outputs.current_tag }}
- name: CocoaPods
run: set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose
- name: Deploy CocoaPods
Expand All @@ -19,10 +44,15 @@ jobs:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

docs:
upload-assets:
needs: release
if: needs.release.outputs.current_tag != ''
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ needs.release.outputs.current_tag }}
- name: Cache Gems
id: cache-gems
uses: actions/cache@v2
Expand All @@ -31,25 +61,34 @@ jobs:
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Install Bundle
- name: Submodules and Bundle Install
run: |
bundle config path vendor/bundle
git submodule update --init --recursive
sudo gem install bundler
bundle config set path 'vendor/bundle'
bundle install
- name: Create Jazzy Docs
run: |
./Scripts/jazzy.sh
- name: Build Release
run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake package:release
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Deploy Jazzy Docs
uses: peaceiris/actions-gh-pages@v3
DEVELOPER_DIR: ${{ env.CI_XCODE_11 }}
- name: Deploy assets
uses: svenstaro/upload-release-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/release/*
tag: ${{ needs.release.outputs.current_tag }}
overwrite: true
file_glob: true

release:
publish-docs:
needs: release
if: needs.release.outputs.current_tag != ''
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ needs.release.outputs.current_tag }}
- name: Cache Gems
id: cache-gems
uses: actions/cache@v2
Expand All @@ -58,21 +97,17 @@ jobs:
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Submodules and Bundle Install
- name: Install Bundle
run: |
git submodule update --init --recursive
sudo gem install bundler
bundle config set path 'vendor/bundle'
bundle config path vendor/bundle
bundle install
- name: Build Release
run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake package:release
- name: Create Jazzy Docs
run: |
./Scripts/jazzy.sh
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_11 }}
- name: Deploy assets
uses: svenstaro/upload-release-action@v2
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Deploy Jazzy Docs
uses: peaceiris/actions-gh-pages@v3
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/release/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs

0 comments on commit ee5944c

Please sign in to comment.