|
| 1 | +name: Bump downstreams |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_run: |
| 5 | + workflows: ["Release"] |
| 6 | + types: |
| 7 | + - completed |
| 8 | + |
| 9 | +jobs: |
| 10 | + bump-homebrew-formula: |
| 11 | + name: Bump Homebrew formula |
| 12 | + if: ${{ github.event.workflow_run.conclusion == 'success' }} |
| 13 | + runs-on: macos-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + - name: Get latest tag |
| 19 | + id: latest-tag |
| 20 | + uses: WyriHaximus/github-action-get-previous-tag@v1 |
| 21 | + |
| 22 | + - name: Download artifacts |
| 23 | + uses: dawidd6/action-download-artifact@v4 |
| 24 | + with: |
| 25 | + workflow: release.yml |
| 26 | + workflow_conclusion: success |
| 27 | + |
| 28 | + - name: Get new version sha256 |
| 29 | + id: sha256 |
| 30 | + env: |
| 31 | + VERSION: ${{ steps.latest-tag.outputs.tag }} |
| 32 | + run: | |
| 33 | + mac_amd_sha256=$(shasum -a 256 eca-native-macos-amd64.zip/eca-native-macos-amd64.zip | awk '{print $1}') |
| 34 | + mac_arm_sha256=$(shasum -a 256 eca-native-macos-aarch64.zip/eca-native-macos-aarch64.zip | awk '{print $1}') |
| 35 | + linuxsha256=$(shasum -a 256 eca-native-linux-amd64.zip/eca-native-linux-amd64.zip | awk '{print $1}') |
| 36 | + static_linuxsha256=$(shasum -a 256 eca-native-static-linux-amd64.zip/eca-native-static-linux-amd64.zip | awk '{print $1}') |
| 37 | + echo "::set-output name=linuxsha256::$linuxsha256" |
| 38 | + echo "::set-output name=static_linuxsha256::$static_linuxsha256" |
| 39 | + echo "::set-output name=mac_amd_sha256::$mac_amd_sha256" |
| 40 | + echo "::set-output name=mac_arm_sha256::$mac_arm_sha256" |
| 41 | +
|
| 42 | + - name: Install Babashka |
| 43 | + run: curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install | sudo bash |
| 44 | + |
| 45 | + - name: Bump Homebrew formula |
| 46 | + env: |
| 47 | + VERSION: ${{ steps.latest-tag.outputs.tag }} |
| 48 | + MAC_ARM_SHA256: ${{ steps.sha256.outputs.mac_arm_sha256 }} |
| 49 | + MAC_AMD_SHA256: ${{ steps.sha256.outputs.mac_amd_sha256 }} |
| 50 | + LINUX_SHA256: ${{ steps.sha256.outputs.linuxsha256 }} |
| 51 | + STATIC_LINUX_SHA256: ${{ steps.sha256.outputs.static_linuxsha256 }} |
| 52 | + run: | |
| 53 | + git config --global user.name "Eric Dallo (ECA)" |
| 54 | + git config --global user.email "[email protected]" |
| 55 | + mkdir ~/.ssh && touch ~/.ssh/id_rsa |
| 56 | + echo "${{ secrets.ECA_TOKEN }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa |
| 57 | + git clone [email protected]:editor-code-assistant/homebrew-brew.git |
| 58 | + cd homebrew-brew |
| 59 | + bb -o render.clj --version "${{ env.VERSION }}" --mac-arm-sha "${{ env.MAC_ARM_SHA256 }}" --mac-amd-sha "${{ env.MAC_AMD_SHA256 }}" --linux-sha "${{ env.LINUX_SHA256 }}" --static-linux-sha "${{ env.STATIC_LINUX_SHA256 }}" > eca.rb |
| 60 | + cat eca.rb |
| 61 | + git add . |
| 62 | + git commit -m "Bump to version: ${{ env.VERSION }}" |
| 63 | + git push |
0 commit comments