Bump downstreams #185
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bump downstreams | |
| on: | |
| workflow_run: | |
| workflows: ["Release"] | |
| types: | |
| - completed | |
| jobs: | |
| bump-homebrew-formula: | |
| name: Bump Homebrew formula | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get latest tag | |
| id: latest-tag | |
| uses: WyriHaximus/github-action-get-previous-tag@v1 | |
| - name: Download artifacts | |
| uses: dawidd6/action-download-artifact@v4 | |
| with: | |
| workflow: release.yml | |
| workflow_conclusion: success | |
| - name: Get new version sha256 | |
| id: sha256 | |
| env: | |
| VERSION: ${{ steps.latest-tag.outputs.tag }} | |
| run: | | |
| mac_amd_sha256=$(shasum -a 256 eca-native-macos-amd64.zip/eca-native-macos-amd64.zip | awk '{print $1}') | |
| mac_arm_sha256=$(shasum -a 256 eca-native-macos-aarch64.zip/eca-native-macos-aarch64.zip | awk '{print $1}') | |
| linuxsha256=$(shasum -a 256 eca-native-linux-amd64.zip/eca-native-linux-amd64.zip | awk '{print $1}') | |
| static_linuxsha256=$(shasum -a 256 eca-native-static-linux-amd64.zip/eca-native-static-linux-amd64.zip | awk '{print $1}') | |
| echo "::set-output name=linuxsha256::$linuxsha256" | |
| echo "::set-output name=static_linuxsha256::$static_linuxsha256" | |
| echo "::set-output name=mac_amd_sha256::$mac_amd_sha256" | |
| echo "::set-output name=mac_arm_sha256::$mac_arm_sha256" | |
| - name: Install Babashka | |
| run: curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install | sudo bash | |
| - name: Bump Homebrew formula | |
| env: | |
| VERSION: ${{ steps.latest-tag.outputs.tag }} | |
| MAC_ARM_SHA256: ${{ steps.sha256.outputs.mac_arm_sha256 }} | |
| MAC_AMD_SHA256: ${{ steps.sha256.outputs.mac_amd_sha256 }} | |
| LINUX_SHA256: ${{ steps.sha256.outputs.linuxsha256 }} | |
| STATIC_LINUX_SHA256: ${{ steps.sha256.outputs.static_linuxsha256 }} | |
| run: | | |
| git config --global user.name "Eric Dallo (ECA)" | |
| git config --global user.email "ercdll1337+eca@gmail.com" | |
| mkdir ~/.ssh && touch ~/.ssh/id_rsa | |
| echo "${{ secrets.ECA_COMMIT_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa | |
| git clone git@github.com:editor-code-assistant/homebrew-brew.git | |
| cd homebrew-brew | |
| 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 | |
| cat eca.rb | |
| git add . | |
| git commit -m "Bump to version: ${{ env.VERSION }}" | |
| git push |