diff --git a/.github/workflows/update-formulas.yml b/.github/workflows/update-formulas.yml new file mode 100644 index 00000000..2e042fd9 --- /dev/null +++ b/.github/workflows/update-formulas.yml @@ -0,0 +1,56 @@ +--- +name: Update Formulas +on: + schedule: + - cron: "0 3 * * *" + workflow_dispatch: + inputs: + extraArgs: + description: "Extra arguments passed to emacs-builder cask update" + required: false + default: "" + +jobs: + update: + runs-on: macos-10.15 + steps: + - name: Checkout tap repository + uses: actions/checkout@v2 + with: + path: tap + - name: Symlink homebrew tap + run: | + mkdir -p '$(brew --repo)/Library/Taps/jimeh' + ln -s '${{ github.workspace }}/tap' \ + '$(brew --repo)/Library/Taps/jimeh/homebrew-emacs-builds' + - name: brew livecheck + run: >- + brew livecheck --json --quiet --tap jimeh/emacs-builds + > livecheck-results.json + - name: Upload livecheck-results.json artifact + uses: actions/upload-artifact@v2 + with: + name: livecheck-results.json + path: livecheck-results.json + if-no-files-found: error + - name: Checkout build-emacs-for-macos for emacs-builder tool + uses: actions/checkout@v2 + with: + repository: jimeh/build-emacs-for-macos + ref: "v0.6.1" + path: builder + - uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Pre-build emacs-builder tool + run: make build + working-directory: builder + - name: Update Cask formulas + run: >- + builder/bin/emacs-builder cask update + --builds-repository jimeh/emacs-builds + --templates-dir tap/templates + ${{ github.event.inputs.extraArgs }} + livecheck-results.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}