10
10
auto-release :
11
11
runs-on : ubuntu-latest
12
12
if : " !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
13
- outputs :
14
- auto-version : ${{ steps.auto-version.outputs.version }}
15
13
steps :
16
14
- name : Checkout source
17
15
uses : actions/checkout@v2
26
24
wget -O- https://github.com/intuit/auto/releases/download/v10.16.1/auto-linux.gz | gunzip > ~/auto
27
25
chmod a+x ~/auto
28
26
29
- - name : Set up Python
30
- uses : actions/setup-python@v2
31
- with :
32
- python-version : ' ^3.7'
33
-
34
- - name : Install Python dependencies
35
- run : python -m pip install build bump2version twine
36
-
37
27
- name : Check whether a release is due
38
28
id : auto-version
39
29
run : |
@@ -42,42 +32,40 @@ jobs:
42
32
env :
43
33
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44
34
35
+ - name : Set up Python
36
+ if : steps.auto-version.outputs.version != ''
37
+ uses : actions/setup-python@v2
38
+ with :
39
+ python-version : ' ^3.7'
40
+
41
+ - name : Install Python dependencies
42
+ if : steps.auto-version.outputs.version != ''
43
+ run : python -m pip install build bump2version twine
44
+
45
45
- name : Create release
46
+ if : steps.auto-version.outputs.version != ''
46
47
run : ~/auto shipit
47
48
env :
48
49
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49
50
TWINE_USERNAME : __token__
50
51
TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
51
52
52
- build-docker :
53
- runs-on : ubuntu-latest
54
- needs : auto-release
55
- if : needs.auto-release.outputs.auto-version != ''
56
- steps :
57
- - name : Get tag of latest release
58
- id : latest-release
59
- run : |
60
- latest_tag="$(curl -fsSL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r .tag_name)"
61
- echo "::set-output name=tag::$latest_tag"
62
-
63
- - name : Checkout source
64
- uses : actions/checkout@v2
65
- with :
66
- ref : ${{ steps.latest-release.outputs.tag }}
67
-
68
53
- name : Generate Dockerfile
54
+ if : steps.auto-version.outputs.version != ''
69
55
run : bash gen-docker-image.sh
70
56
working-directory : utils
71
57
72
58
- name : Build Docker images
59
+ if : steps.auto-version.outputs.version != ''
73
60
run : |
74
61
docker build \
75
62
-t nipy/heudiconv:master \
76
63
-t nipy/heudiconv:latest \
77
- -t nipy/heudiconv:${{ steps.latest-release.outputs.tag }} \
64
+ -t nipy/heudiconv:"$(git describe)" \
78
65
.
79
66
80
67
- name : Push Docker images
68
+ if : steps.auto-version.outputs.version != ''
81
69
run : |
82
70
docker login -u "$DOCKER_LOGIN" --password-stdin <<<"$DOCKER_TOKEN"
83
71
docker push --all-tags nipy/heudiconv
0 commit comments