From 3dad67d1ef495eb6b2c200b1a9064ac4b062bcb7 Mon Sep 17 00:00:00 2001 From: Dave Hart Date: Mon, 30 Nov 2020 14:34:18 -0500 Subject: [PATCH 1/2] Draft release on every push to master, overwriting uploaded assets from any previous PR merge --- .github/workflows/CI.yml | 41 +++++++++++--------------- .github/workflows/draft-release.yml | 15 ---------- .github/workflows/publish-podspecs.yml | 27 +++++++++++++++++ 3 files changed, 45 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/draft-release.yml create mode 100644 .github/workflows/publish-podspecs.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 647e690..1ff3c27 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,8 +2,8 @@ name: CI on: pull_request: branches: [ master ] - release: - types: [ published ] + push: + branches: [ master ] jobs: build-iOS: @@ -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 @@ -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 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml deleted file mode 100644 index 490103e..0000000 --- a/.github/workflows/draft-release.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Release Drafter - -on: - push: - branches: - - master - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-podspecs.yml b/.github/workflows/publish-podspecs.yml new file mode 100644 index 0000000..118c5bb --- /dev/null +++ b/.github/workflows/publish-podspecs.yml @@ -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/get-release@v1.2.2 + 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 From 51b485aeafa691fc351548c2dc34d7e57112bd24 Mon Sep 17 00:00:00 2001 From: Dave Hart Date: Mon, 30 Nov 2020 14:39:26 -0500 Subject: [PATCH 2/2] Lint YML --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1ff3c27..d7a4b78 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -115,7 +115,7 @@ jobs: draft-release: runs-on: ubuntu-latest needs: [ build-iOS, build-macOS, build-docs ] - if: github.event_name == 'push' && && github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - name: Checkout Project uses: actions/checkout@v2