-
Notifications
You must be signed in to change notification settings - Fork 87
159 lines (132 loc) · 4.79 KB
/
build.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Build
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 20
RENOVATE_VERSION: 37.176.0 # renovate: datasource=docker depName=renovate packageName=ghcr.io/renovatebot/renovate
jobs:
commitlint:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Lint commit messages
uses: wagoid/commitlint-github-action@5ce82f5d814d4010519d15f0552aec4f17a1e1fe # v5.4.5
continue-on-error: true
lint:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- name: enable corepack
run: corepack enable
- name: Install project
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
e2e:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
strategy:
fail-fast: false
matrix:
configurationFile: [example/renovate-config.js, example/renovate.json]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- name: enable corepack
run: corepack enable
- name: Install project
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Configure renovate token
run: |
if [[ "${RENOVATE_TOKEN}" != "" ]]; then
echo "RENOVATE_TOKEN=${RENOVATE_TOKEN}" >> $GITHUB_ENV
else
echo "RENOVATE_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
- name: Renovate test
uses: ./
env:
LOG_LEVEL: debug
with:
configurationFile: ${{ matrix.configurationFile }}
renovate-version: ${{ env.RENOVATE_VERSION }}
- name: Renovate test with entrypoint
uses: ./
env:
LOG_LEVEL: debug
with:
configurationFile: ${{ matrix.configurationFile }}
renovate-version: ${{ env.RENOVATE_VERSION }}
docker-cmd-file: example/entrypoint.sh
docker-user: root
release:
needs: [lint, commitlint, e2e]
runs-on: ubuntu-latest
steps:
- name: Setup Git user
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global user.email 'bot@renovateapp.com'
git config --global user.name 'Renovate Bot'
yarn config set version-git-tag false
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
ref: 'release'
- name: fetch pr
if: ${{github.event_name == 'pull_request'}}
run: git fetch origin +${{ github.sha }}:${{ github.ref }}
- name: Merge main
id: merge
run: |
git merge --no-ff -Xtheirs -m 'skip: merge (${{ github.sha }}) [skip release]' ${{ github.sha }}
commit=$(git rev-parse HEAD)
- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- name: enable corepack
run: corepack enable
- name: Install project
run: yarn install --frozen-lockfile
- name: Push release branch
run: git push origin release:release
if: ${{ github.ref_name == github.event.repository.default_branch }}
- name: Release
run: |
# override for semantic-release
export GITHUB_REF=refs/heads/release GITHUB_SHA=${{ steps.merge.outputs.commit }}
yarn release
if: ${{ github.ref_name == github.event.repository.default_branch }}
env:
GITHUB_TOKEN: ${{ github.token }}