-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (52 loc) · 1.65 KB
/
cd.yml
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
name: CD
on:
schedule:
- cron: "0 0 * * 3"
workflow_dispatch:
env:
TASK_X_REMOTE_TASKFILES: 1
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
secrets: inherit
release:
name: Release
needs: [ci]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
GH_TOKEN: ${{ github.token }}
run: |-
gh repo clone ${{ github.repository }} ${{ github.workspace }} -- --branch "$BRANCH"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install tools
run: |
echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH"
/home/linuxbrew/.linuxbrew/bin/brew install \
commitizen \
go \
go-task \
goreleaser \
- name: Bump
run: |-
echo "PREVIOUS_REVISION=$(cz version --project)" >>"$GITHUB_ENV"
task bump --yes
echo "REVISION=$(cz version --project)" >>"$GITHUB_ENV"
- name: Push tags
if: env.PREVIOUS_REVISION != env.REVISION
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
REMOTE_REPO: https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git
run: git push "$REMOTE_REPO" "HEAD:${BRANCH}" --tags
- name: Release
if: env.PREVIOUS_REVISION != env.REVISION
env:
AUR_KEY: ${{ secrets.AUR_KEY }}
GITHUB_TOKEN: ${{ github.token }}
run: task release --yes