-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (61 loc) · 1.97 KB
/
ci.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
name: ci
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
revision:
description: "The revision of the source code to checkout"
required: true
type: string
fetch_depth:
description: "The depth to fetch"
required: true
default: "1"
type: string
id:
description: "The unique identifier to indentify the workflow run"
required: true
type: string
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: |
git config --global user.email "[email protected]"
git config --global user.name "ci"
make install_dev
make isort_check
make lint
make test
release:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: check if version changed
run: |
export VERSION=$(python -c "from core.__version__ import __version__; print(__version__)")
export VERSION_LINE_OID=$(git blame core/__version__.py --root -l | grep "VERSION = " | cut -c 1-40)
export HEAD_OID=$(git log -1 --format='%H')
if [ "$VERSION_LINE_OID" == "$HEAD_OID" ]; then echo "UPGRADE=1" >> $GITHUB_OUTPUT; echo "VERSION=$VERSION" >> $GITHUB_OUTPUT; fi
id: check_version
- name: package
if: ${{ steps.check_version.outputs.UPGRADE == '1' }}
run: |
make install_dev
make package
- name: release
uses: ncipollo/release-action@v1
if: ${{ steps.check_version.outputs.UPGRADE == '1' }}
with:
name: ${{ steps.check_version.outputs.VERSION }}
tag: ${{ steps.check_version.outputs.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: false
artifacts: hab.pex