summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: c2129916dbc76991b04a0806a1c3d801a0030ea6 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Post release triggers

on: 
  release:
    types: [published]


jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Get tag name
        shell: bash
        run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF##*/})"
        id: tag_name

      - name: Update Homebrew recipe
        uses: peter-evans/repository-dispatch@v1
        with:
          token: ${{ secrets.REPO_ACCESS_TOKEN }}
          repository: xxxserxxx/homebrew-gotop
          event-type: my-release
          client-payload: '{"tag": "${{ steps.tag_name.outputs.tag }}"}'

      - name: Update and inform Homebrew
        uses: dawidd6/action-homebrew-bump-formula@v3
        with:
          token: ${{ secrets.homebrew }}
          formula: gotop
          revision: ${{ steps.tag_name.outputs.tag }}

      - name: Update Arch AURs
        uses: peter-evans/repository-dispatch@v1
        with:
          token: ${{ secrets.REPO_ACCESS_TOKEN }}
          repository: xxxserxxx/gotop-linux
          event-type: my-release
          client-payload: '{"tag": "${{ steps.tag_name.outputs.tag }}"}'

      - name: Trigger extensions build
        uses: peter-evans/repository-dispatch@v1
        with:
          token: ${{ secrets.REPO_ACCESS_TOKEN }}
          repository: xxxserxxx/gotop-builder
          event-type: my-release
          client-payload: '{"tag": "${{ steps.tag_name.outputs.tag }}"}'

      - name: Update current release badge
        shell: bash
        run: sed -i "s/v[0-9]*\.[0-9]*\.[0-9]*/${{steps.tag_name.outputs.tag}}/g" docs/release.svg

      - name: Commit current release badge
        uses: stefanzweifel/git-auto-commit-action@v4.1.0
        with:
            branch: 'master'
            commit_message: Update release badge to version "${{ steps.tag_name.outputs.tag }}"

            # Optional glob pattern of files which should be added to the commit
            file_pattern: docs/release.svg

            # Optional commit user and author settings
            commit_user_name: Badge Updater
            commit_user_email: ser@ser1.net
            commit_author: Badge Updater <ser@ser1.net>