|
|
@@ -396,3 +396,52 @@ jobs:
|
|
|
- name: Push
|
|
|
run: |
|
|
|
docker push public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}}
|
|
|
+ update-homebrew-repo:
|
|
|
+ name: Update the Homebrew repo with the new CLI version
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ needs: release
|
|
|
+ steps:
|
|
|
+ - name: Get tag name
|
|
|
+ id: tag_name
|
|
|
+ run: |
|
|
|
+ tag=${GITHUB_TAG/refs\/tags\//}
|
|
|
+ echo ::set-output name=tag::$tag
|
|
|
+ env:
|
|
|
+ GITHUB_TAG: ${{ github.ref }}
|
|
|
+ - name: Download binaries
|
|
|
+ uses: actions/download-artifact@v2
|
|
|
+ with:
|
|
|
+ name: mac-binaries
|
|
|
+ path: release/darwin
|
|
|
+ - name: Create and commit porter.rb file
|
|
|
+ run: |
|
|
|
+ sha=$(cat ./release/darwin/porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip | openssl sha256 | sed 's/(stdin)= //g')
|
|
|
+
|
|
|
+ cat >porter.rb <<EOL
|
|
|
+ class Porter < Formula
|
|
|
+ homepage "https://porter.run"
|
|
|
+ version "${{steps.tag_name.outputs.tag}}"
|
|
|
+
|
|
|
+ on_macos do
|
|
|
+ url "https://github.com/porter-dev/porter/releases/download/${{steps.tag_name.outputs.tag}}/porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip"
|
|
|
+ sha256 "$sha"
|
|
|
+
|
|
|
+ def install
|
|
|
+ bin.install "porter"
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+ EOL
|
|
|
+ - name: Add and commit porter.rb file
|
|
|
+ run: |
|
|
|
+ git clone https://abelanger5:${{ secrets.HOMEBREW_GITHUB_TOKEN }}@github.com/porter-dev/homebrew-porter
|
|
|
+
|
|
|
+ cd homebrew-porter
|
|
|
+ git config user.name "Update Bot"
|
|
|
+ git config user.email "support@porter.run"
|
|
|
+
|
|
|
+ mv ../porter.rb ./Formula/porter.rb
|
|
|
+
|
|
|
+ git add Formula
|
|
|
+ git commit -m "Update to version ${{steps.tag_name.outputs.tag}}"
|
|
|
+ git push origin main
|