Skip to content

Commit

Permalink
Merge pull request #50 from openziti/dev
Browse files Browse the repository at this point in the history
Draft release on push to master, overwriting uploaded assets from any previous PR merge
  • Loading branch information
smilindave26 authored Nov 30, 2020
2 parents 4faa2f7 + 51b485a commit eda3ffd
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 38 deletions.
41 changes: 18 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: CI
on:
pull_request:
branches: [ master ]
release:
types: [ published ]
push:
branches: [ master ]

jobs:
build-iOS:
Expand Down Expand Up @@ -112,10 +112,10 @@ jobs:
name: ziti-sdk-swift-docs
path: ziti-sdk-swift-docs.tgz

release:
runs-on: macos-latest
draft-release:
runs-on: ubuntu-latest
needs: [ build-iOS, build-macOS, build-docs ]
if: github.event_name == 'release' && github.event.action == 'published'
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout Project
uses: actions/checkout@v2
Expand All @@ -137,46 +137,41 @@ jobs:
with:
name: CZiti-macOS.framework

- name: Get Release
id: get_release
uses: bruceadams/get-release@v1.2.2
- name: Draft Release
id: release_drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Docs
uses: actions/upload-release-asset@v1
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./ziti-sdk-swift-docs.tgz
asset_name: ziti-sdk-swift-docs.tgz
asset_content_type: application/tgz
overwrite: true

- name: Upload iOS Framework
uses: actions/upload-release-asset@v1
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./CZiti-iOS.framework.tgz
asset_name: CZiti-iOS.framework.tgz
asset_content_type: application/tgz
overwrite: true

- name: Upload macOS Framework
uses: actions/upload-release-asset@v1
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./CZiti-macOS.framework.tgz
asset_name: CZiti-macOS.framework.tgz
asset_content_type: application/tgz

- name: Push Podspecs
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
echo ${{ steps.get_release.outputs.tag_name }} > version
pod trunk push CZiti-iOS.podspec
pod trunk push CZiti-macOS.podspec
overwrite: true
15 changes: 0 additions & 15 deletions .github/workflows/draft-release.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/publish-podspecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: publish podspecs
on:
release:
types: [ published ]

jobs:
publish:
runs-on: macos-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get Release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Push Podspecs
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
echo ${{ steps.get_release.outputs.tag_name }} > version
pod trunk push CZiti-iOS.podspec
pod trunk push CZiti-macOS.podspec

0 comments on commit eda3ffd

Please sign in to comment.