summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cd.yml
blob: 7a9233c25d683efa2c6e5f61cb10627ca862133e (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
name: Continuous Delivery

on:
  push:
    tags:
      - 'v*'

jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Unshallow repo
        run: git fetch --prune --unshallow
      - name: Setup Go
        uses: actions/setup-go@v1
        with:
          go-version: 1.14.x
      - name: Run goreleaser
        uses: goreleaser/goreleaser-action@v1
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_API_TOKEN}}
  homebrew:
    runs-on: macos-latest
    steps:
      - name: Bump Homebrew formula
        uses: dawidd6/action-homebrew-bump-formula@v3
        with:
          token: ${{secrets.GITHUB_API_TOKEN}}
          formula: lazygit
  ppa:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout PPA repo
        uses: actions/checkout@v2
        with:
          repository: dawidd6/lazygit-debian
          token: ${{secrets.GITHUB_API_TOKEN}}
          fetch-depth: 0
      - name: Setup git
        uses: dawidd6/action-git-user-config@v1
      - name: Update PPA repo
        run: |
          version="$(echo "$GITHUB_REF" | sed 's@refs/tags/v@@')"
          sudo apt update
          sudo apt install -y git-buildpackage
          git fetch --tags https://github.com/$GITHUB_REPOSITORY
          gbp import-ref -u "$version"
          gbp dch -D xenial -N "$version"-1
          git add debian/changelog
          git commit -m "d/changelog: dch $version"
          gbp tag
          git push --tags origin master