Skip to content

Publish

Publish #42

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
version:
description: semantic version to publish
required: true
concurrency:
group: publish-{{github.event.inputs.version}}
cancel-in-progress: true
jobs:
ci:
uses: ./.github/workflows/ci.yml
lint:
runs-on: macos-latest
strategy:
matrix:
xcode:
- ^13
- ^14
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- uses: actions/checkout@v3
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@v3
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 [email protected]
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