-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (59 loc) · 1.88 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
name: build
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version-file: .python-version
cache: pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run pre-commit
run: >-
pre-commit try-repo --all-files
--ref="${GITHUB_SHA}"
"${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [test]
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get Renovate version
id: get-renovate-version
uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 # v4.44.3
with:
cmd: >-
yq eval
'.[]|select(.id=="renovate-config-validator")|.additional_dependencies[0]|split("@").[1]'
.pre-commit-hooks.yaml
- name: Create release
run: |
if ! gh release view "${TAG}" >/dev/null; then
gh release create "${TAG}" \
--notes "See https://github.com/renovatebot/renovate/releases/tag/${TAG} for more changes" \
--target "${TARGET}" \
--title "${TAG}"
else
echo 'release already exists'
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.get-renovate-version.outputs.result }}
TARGET: ${{ github.sha }}