|
| 1 | +name: Update Homebrew Formula |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +jobs: |
| 8 | + homebrew-release: |
| 9 | + |
| 10 | + runs-on: macOS-latestcd |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checks if pre-release |
| 14 | + if: github.event.release.prerelease == true |
| 15 | + run: | |
| 16 | + echo This is running against a pre-release. |
| 17 | + echo Skipping all the next steps. |
| 18 | + - uses: actions/checkout@v1 |
| 19 | + if: github.event.release.prerelease != true |
| 20 | + - name: Use Node.js 12.x |
| 21 | + uses: actions/setup-node@v1 |
| 22 | + if: github.event.release.prerelease != true |
| 23 | + with: |
| 24 | + node-version: 12.x |
| 25 | + - name: Setup git |
| 26 | + if: github.event.release.prerelease != true |
| 27 | + run: | |
| 28 | + eval "$(ssh-agent -s)" |
| 29 | + mkdir -p ~/.ssh |
| 30 | + ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts |
| 31 | + echo "${{ secrets.DEPLOY_KEY_HOMEBREW_GARDEN }}" > ~/.ssh/homebrew_id |
| 32 | + chmod 600 ~/.ssh/homebrew_id |
| 33 | + ssh-add -K ~/.ssh/homebrew_id |
| 34 | + sudo git config user.email "e.libralato@gmail.com" |
| 35 | + sudo git config user.name "Github Actions" |
| 36 | + tee -a ~/.ssh/config << END |
| 37 | + Host github.com |
| 38 | + AddKeysToAgent yes |
| 39 | + UseKeychain yes |
| 40 | + IdentityFile ~/.ssh/homebrew_id |
| 41 | + END |
| 42 | + - name: Release Homebrew Formula |
| 43 | + if: github.event.release.prerelease != true |
| 44 | + uses: garden-io/update-homebrew-action@v1 |
| 45 | + with: |
| 46 | + packageName: 'garden-cli' |
| 47 | + templatePath: 'support/homebrew-formula.rb' |
| 48 | + tapRepo: 'garden-io/homebrew-garden' |
| 49 | + srcRepo: 'garden-io/garden' |
| 50 | + authToken: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + - name: Test Homebrew package |
| 52 | + if: github.event.release.prerelease != true |
| 53 | + run: | |
| 54 | + echo 'Testing brew install' |
| 55 | + brew tap garden-io/garden |
| 56 | + brew install garden-cli |
| 57 | + echo 'Running garden --version' |
| 58 | + garden --version |
0 commit comments