From 0edae907502a16428abcdb937628941d6bd162bf Mon Sep 17 00:00:00 2001 From: Mattt Date: Tue, 29 Sep 2020 11:27:38 -0700 Subject: [PATCH 1/3] Rename Deploy workflow to Publish --- .github/workflows/{deploy.yml => publish.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{deploy.yml => publish.yml} (98%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/publish.yml similarity index 98% rename from .github/workflows/deploy.yml rename to .github/workflows/publish.yml index 4705cd6a..0a5108c2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,8 @@ -name: Deploy +name: Publish on: release: - types: [published] + types: [created, published] jobs: macos: From ff384ca485aeb8ca92c52a994c6f92e211fec1a9 Mon Sep 17 00:00:00 2001 From: Mattt Date: Tue, 29 Sep 2020 11:28:48 -0700 Subject: [PATCH 2/3] Pass GH_PERSONAL_ACCESS_TOKEN as GITHUB_TOKEN --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97e51735..a5343a55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - name: Create Release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} From 12dfa515f75b7623b58cb66614daf6ddfe22d3ee Mon Sep 17 00:00:00 2001 From: Mattt Date: Tue, 13 Oct 2020 09:49:17 -0700 Subject: [PATCH 3/3] Update publish workflow --- .github/workflows/publish.yml | 84 ++++++++++------------------------- 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a5108c2..481443e1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,83 +5,47 @@ on: types: [created, published] jobs: - macos: - name: Upload macOS Catalina release binary - runs-on: macos-10.15 - - strategy: - matrix: - xcode: - - "12" # Swift 5.3 - + formula: + name: Update Homebrew formula + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Update the Homebrew formula with latest release + uses: NSHipster/update-homebrew-formula-action@main with: - ref: ${{ github.event.release.tag_name }} - - name: Build and Package - run: | - make swift-doc - tar -cf swift-doc-${{ github.event.release.tag_name }}.catalina.bottle.tar swift-doc - gzip -f swift-doc-${{ github.event.release.tag_name }}.catalina.bottle.tar - env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - - name: Upload - uses: actions/upload-release-asset@v1.0.1 + repository: SwiftDocOrg/swift-doc + tap: SwiftDocOrg/homebrew-formulae + formula: Formula/swift-doc.rb env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./swift-doc - asset_name: swift-doc-${{ github.event.release.tag_name }}.catalina.bottle.tar.gz - asset_content_type: application/gzip - - linux: - name: Upload Linux release binary - - runs-on: ubuntu-latest - - strategy: - matrix: - swift: ["5.3"] - - container: - image: swift:${{ matrix.swift }} + bottle: + name: Build and distribute Homebrew bottle for macOS Catalina + runs-on: macos-10.15 + needs: [formula] steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.tag_name }} - - name: Install System Dependencies + - name: Build a bottle using Homebrew run: | - apt-get update - apt-get install -y libxml2-dev graphviz - - name: Build and Package - run: | - make swift-doc - tar -cf swift-doc-${{ github.event.release.tag_name }}.linux.bottle.tar.gz swift-doc - gzip -f swift-doc-${{ github.event.release.tag_name }}.linux.bottle.tar.gz - - name: Upload + brew tap swiftdocorg/formulae + brew install --build-bottle --verbose swift-doc + brew bottle swift-doc + - name: Upload the bottle to the GitHub release uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: ./swift-doc - asset_name: swift-doc-${{ github.event.release.tag_name }}.linux.bottle.tar.gz + asset_path: ./swift-doc--${{ github.event.release.tag_name }}.catalina.bottle.tar.gz + asset_name: swift-doc-${{ github.event.release.tag_name }}.catalina.bottle.tar.gz asset_content_type: application/gzip - - homebrew: - name: Update Homebrew formula - runs-on: ubuntu-latest - needs: [macos, linux] - steps: - - uses: NSHipster/update-homebrew-formula-action@main + - name: Update the Homebrew formula again with bottle + uses: NSHipster/update-homebrew-formula-action@main with: repository: SwiftDocOrg/swift-doc tap: SwiftDocOrg/homebrew-formulae formula: Formula/swift-doc.rb + message: | + Add bottle for swift-doc ${{ github.event.release.tag_name }} + on macOS Catalina env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}