Skip to content

Publish

Publish #34

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
version:
description: Version to publish
required: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: CI
token: ${{ secrets.JAZZY_PAT }}
wait-for-completion: true
lint:
runs-on: macos-latest
strategy:
matrix:
xcode:
- ^11
- ^12
- ^13
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- uses: actions/checkout@v2
with:
submodules: true
- run: pod lib lint --fail-fast --allow-warnings
create-release:
runs-on: ubuntu-latest
needs: [ci, lint]
env:
v: ${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # zero means “all” (or push fails)
- name: Update committed versions
run: |
ruby -i -pe "sub(/CURRENT_PROJECT_VERSION = [0-9.]+/, 'CURRENT_PROJECT_VERSION = $v')" PromiseKit.xcodeproj/project.pbxproj
ruby -i -pe "sub(/s.version = '[0-9.]+'/, 's.version = \'$v\'')" PromiseKit.podspec
- run: |
! (git diff --quiet)
- name: Commit
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git commit -am "PromiseKit $v"
git push
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
cd:
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: CD
token: ${{ secrets.JAZZY_PAT }}
inputs: "{\"version\": \"${{ github.event.inputs.version }}\"}"
ref: ${{ env.GITHUB_REF_NAME }} # or uses the SHA rather than branch and thus the above commit is not used
wait-for-completion: true