summaryrefslogtreecommitdiffstats
path: root/.github/workflows/post-deploy.yml
blob: 425fe299773638805a3faff4cae939bc4f90e45d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Update Packages

on:
  release:
    types: [published]

jobs:
  post-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Set env
        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

      - name: Test env
        run: |
          echo $RELEASE_VERSION

      - name: Make sure you're not on master...
        run: |
          if [[ $RELEASE_VERSION == "master" ]]; then
            exit 1
          fi

      - name: Trigger homebrew
        run: |
          curl -X POST https://api.github.com/repos/ClementTsang/homebrew-bottom/dispatches \
          -H 'Accept: application/vnd.github.everest-preview+json' \
          -u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
          --data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'

      - name: Trigger choco
        run: |
          curl -X POST https://api.github.com/repos/ClementTsang/choco-bottom/dispatches \
          -H 'Accept: application/vnd.github.everest-preview+json' \
          -u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
          --data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'