diff --git a/.github/workflows/publish.yml b/.github/workflows/cocoapods.yml similarity index 95% rename from .github/workflows/publish.yml rename to .github/workflows/cocoapods.yml index e97342e41..24ca43a69 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/cocoapods.yml @@ -1,4 +1,4 @@ -name: Publish Cocoapods +name: Cocoapods on: release: types: [published] diff --git a/.github/workflows/publish_beta.yml b/.github/workflows/cocoapods_beta.yml similarity index 98% rename from .github/workflows/publish_beta.yml rename to .github/workflows/cocoapods_beta.yml index 7286415f2..e19351e4e 100644 --- a/.github/workflows/publish_beta.yml +++ b/.github/workflows/cocoapods_beta.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: Publish beta +name: Cocoapods beta # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch diff --git a/.github/workflows/cocoapods_beta_manual.yml b/.github/workflows/cocoapods_beta_manual.yml new file mode 100644 index 000000000..05302da17 --- /dev/null +++ b/.github/workflows/cocoapods_beta_manual.yml @@ -0,0 +1,34 @@ +# This is a basic workflow to help you get started with Actions + +name: Cocoapods beta Manual + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: workflow_dispatch + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: macos-latest + # main 分支的发布请走正式流程,手动仅能发布其他分支的beta版本,用于测试 + if: ${{ github.ref != 'refs/heads/master' }} + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Install Cocoapods + run: gem install cocoapods + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Create CocoaPods beta + run: | + set -eo pipefail + pod repo update + chmod +x Scripts/cocoapods-beta.sh + sh Scripts/cocoapods-beta.sh + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}