chore: Separate original workflow to make build and release logic
reusuable for different triggers
This commit is contained in:
parent
5f3fb80788
commit
4be236073a
2 changed files with 53 additions and 29 deletions
44
.github/workflows/build-and-release.yaml
vendored
Normal file
44
.github/workflows/build-and-release.yaml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
name: Build and Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
release-version:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
draft-flag:
|
||||||
|
type: string
|
||||||
|
default: -draft
|
||||||
|
secrets:
|
||||||
|
XCFRAMEWORK_SIGNING_TOKEN:
|
||||||
|
required: true
|
||||||
|
GITHUB_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos-14
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- run: sudo xcode-select --switch /Applications/Xcode_15.1.app
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install dependencies
|
||||||
|
run: brew install ghr
|
||||||
|
- name: Build Capacitor and Cordova
|
||||||
|
run: ./build-cap ${{ inputs.release-version }}
|
||||||
|
- name: Sign Capacitor xcframework
|
||||||
|
uses: ionic-team/sign-xcframework@main
|
||||||
|
with:
|
||||||
|
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
|
||||||
|
xcframework-path: Capacitor.xcframework
|
||||||
|
- name: Sign Cordova xcframework
|
||||||
|
uses: ionic-team/sign-xcframework@main
|
||||||
|
with:
|
||||||
|
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
|
||||||
|
xcframework-path: Cordova.xcframework
|
||||||
|
- name: Package Capacitor and Cordova
|
||||||
|
run: ./package-cap ${{ inputs.release-version }}
|
||||||
|
- name: Push manifest update
|
||||||
|
uses: EndBug/add-and-commit@v9
|
||||||
|
- name: Create Release
|
||||||
|
run: ghr -token ${{ secrets.GITHUB_TOKEN }} -name ${{ inputs.release-version }} ${{ inputs.draft-flag }} -replace ${{ inputs.release-version }} frameworks
|
||||||
38
.github/workflows/pre-release.yml
vendored
38
.github/workflows/pre-release.yml
vendored
|
|
@ -6,33 +6,13 @@ on:
|
||||||
- "release/**"
|
- "release/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release-version:
|
||||||
runs-on: macos-14
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
|
||||||
steps:
|
steps:
|
||||||
- run: sudo xcode-select --switch /Applications/Xcode_15.1.app
|
- run: echo "release_version=${GITHUB_REF#refs/*/*}" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/checkout@v4
|
create-pre-release:
|
||||||
- name: Install build dependencies
|
needs: release-version
|
||||||
run: |
|
uses: ./github/workflows/build-and-release.yaml
|
||||||
gem install cocoapods xcpretty
|
with:
|
||||||
brew install ghr
|
release-version: ${{ jobs.release-version.outputs.release_version }}
|
||||||
- name: Assign version to RELEASE_VERSION environment variable
|
secrets: inherit
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/*/}" >> $GITHUB_ENV
|
|
||||||
- name: Build Capacitor and Cordova
|
|
||||||
run: ./build-cap $RELEASE_VERSION
|
|
||||||
- name: Sign Capacitor xcframework
|
|
||||||
uses: ionic-team/sign-xcframework@main
|
|
||||||
with:
|
|
||||||
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
|
|
||||||
xcframework-path: Capacitor.xcframework
|
|
||||||
- name: Sign Cordova xcframework
|
|
||||||
uses: ionic-team/sign-xcframework@main
|
|
||||||
with:
|
|
||||||
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
|
|
||||||
xcframework-path: Cordova.xcframework
|
|
||||||
- name: Package Capacitor and Cordova
|
|
||||||
run: ./package-cap $RELEASE_VERSION
|
|
||||||
- name: Push manifest update
|
|
||||||
uses: EndBug/add-and-commit@v9
|
|
||||||
- name: Create Draft Release
|
|
||||||
run: ghr -token ${{ secrets.GITHUB_TOKEN }} -name ${{ env.RELEASE_VERSION }} -draft -replace ${{ env.RELEASE_VERSION }} frameworks
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue