8
8
jobs :
9
9
auto-release :
10
10
runs-on : ubuntu-latest
11
+ if : " !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
11
12
steps :
12
- - name : Checkout source
13
- uses : actions/checkout@v4
14
- with :
15
- fetch-depth : 0
13
+ - uses : actions/checkout@v4
16
14
17
- - name : Download auto
18
- run : |
19
- curl -vL -o - "$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/latest | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')" | gunzip > ~/auto
20
- chmod a+x ~/auto
15
+ - name : Prepare repository
16
+ # Fetch full git history and tags
17
+ run : git fetch --unshallow --tags
21
18
22
- - name : Check whether a release is due
23
- id : auto-version
24
- run : |
25
- version="$(~/auto version)"
26
- echo "version=$version" >> "$GITHUB_OUTPUT"
27
- env :
28
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19
+ - name : Unset header
20
+ # checkout@v2 adds a header that makes branch protection report errors
21
+ # because the Github action bot is not a collaborator on the repo
22
+ run : git config --local --unset http.https://github.com/.extraheader
29
23
30
24
- name : Set up Python
31
- if : steps.auto-version.outputs.version != ''
32
25
uses : actions/setup-python@v5
33
26
with :
34
27
python-version : ' ^3.8'
35
28
36
- - name : Install Python dependencies
37
- if : steps.auto-version.outputs.version != ''
38
- run : python -m pip install build twine
29
+ - name : Download auto
30
+ run : |
31
+ auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/latest | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')"
32
+ wget -O- "$auto_download_url" | gunzip > ~/auto
33
+ chmod a+x ~/auto
39
34
40
35
- name : Create release
41
- if : steps.auto-version.outputs.version != ''
42
- run : ~/auto shipit
43
- env :
44
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
-
46
- - name : Build & upload to PyPI
47
- if : steps.auto-version.outputs.version != ''
48
36
run : |
49
- python -m build
50
- twine upload dist/*
37
+ ~/auto shipit -vv
51
38
env :
52
- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
53
- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
54
-
55
- # vim:set sts=2:
39
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments