Skip to content

Commit b4c4e77

Browse files
committed
Adjust release workflow
1 parent c81da0f commit b4c4e77

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010
auto-release:
1111
runs-on: ubuntu-latest
1212
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 }}
1513
steps:
1614
- name: Checkout source
1715
uses: actions/checkout@v2
@@ -26,14 +24,6 @@ jobs:
2624
wget -O- https://github.com/intuit/auto/releases/download/v10.16.1/auto-linux.gz | gunzip > ~/auto
2725
chmod a+x ~/auto
2826
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-
3727
- name: Check whether a release is due
3828
id: auto-version
3929
run: |
@@ -42,42 +32,40 @@ jobs:
4232
env:
4333
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4434

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+
4545
- name: Create release
46+
if: steps.auto-version.outputs.version != ''
4647
run: ~/auto shipit
4748
env:
4849
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4950
TWINE_USERNAME: __token__
5051
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
5152

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-
6853
- name: Generate Dockerfile
54+
if: steps.auto-version.outputs.version != ''
6955
run: bash gen-docker-image.sh
7056
working-directory: utils
7157

7258
- name: Build Docker images
59+
if: steps.auto-version.outputs.version != ''
7360
run: |
7461
docker build \
7562
-t nipy/heudiconv:master \
7663
-t nipy/heudiconv:latest \
77-
-t nipy/heudiconv:${{ steps.latest-release.outputs.tag }} \
64+
-t nipy/heudiconv:"$(git describe)" \
7865
.
7966
8067
- name: Push Docker images
68+
if: steps.auto-version.outputs.version != ''
8169
run: |
8270
docker login -u "$DOCKER_LOGIN" --password-stdin <<<"$DOCKER_TOKEN"
8371
docker push --all-tags nipy/heudiconv

0 commit comments

Comments
 (0)