Skip to content

Commit 0da0323

Browse files
authored
Merge pull request #558 from nipy/gh-557
Set up auto
2 parents fbe524d + 0442b39 commit 0da0323

File tree

15 files changed

+212
-114
lines changed

15 files changed

+212
-114
lines changed

.autorc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"onlyPublishWithReleaseLabel": true,
3+
"baseBranch": "master",
4+
"author": "auto <auto@nil>",
5+
"noVersionPrefix": false,
6+
"plugins": ["git-tag", "released"]
7+
}

.github/workflows/docker.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout source
13+
uses: actions/checkout@v2
14+
15+
- name: Generate Dockerfile
16+
run: bash gen-docker-image.sh
17+
working-directory: utils
18+
19+
- name: Build Docker image
20+
run: docker build -t nipy/heudiconv:master .
21+
22+
- name: Push Docker image
23+
run: |
24+
docker login -u "$DOCKER_LOGIN" --password-stdin <<<"$DOCKER_TOKEN"
25+
docker push nipy/heudiconv:master
26+
env:
27+
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
28+
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
29+
30+
# vim:set sts=2:

.github/workflows/release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Auto-release on PR merge
2+
3+
on:
4+
# ATM, this is the closest trigger to a PR merging
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
auto-release:
11+
runs-on: ubuntu-latest
12+
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
13+
steps:
14+
- name: Checkout source
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Download auto
20+
run: |
21+
#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
22+
# Pin to 10.16.1 so we don't break if & when
23+
# <https://github.com/intuit/auto/issues/1778> is fixed.
24+
wget -O- https://github.com/intuit/auto/releases/download/v10.16.1/auto-linux.gz | gunzip > ~/auto
25+
chmod a+x ~/auto
26+
27+
- name: Check whether a release is due
28+
id: auto-version
29+
run: |
30+
version="$(~/auto version)"
31+
echo "::set-output name=version::$version"
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 twine
44+
45+
- name: Create release
46+
if: steps.auto-version.outputs.version != ''
47+
run: ~/auto shipit
48+
env:
49+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Build & upload to PyPI
52+
if: steps.auto-version.outputs.version != ''
53+
run: |
54+
python -m build
55+
twine upload dist/*
56+
env:
57+
TWINE_USERNAME: __token__
58+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
59+
60+
- name: Generate Dockerfile
61+
if: steps.auto-version.outputs.version != ''
62+
run: bash gen-docker-image.sh
63+
working-directory: utils
64+
65+
- name: Build Docker images
66+
if: steps.auto-version.outputs.version != ''
67+
run: |
68+
docker build \
69+
-t nipy/heudiconv:master \
70+
-t nipy/heudiconv:latest \
71+
-t nipy/heudiconv:"$(git describe)" \
72+
.
73+
74+
- name: Push Docker images
75+
if: steps.auto-version.outputs.version != ''
76+
run: |
77+
docker login -u "$DOCKER_LOGIN" --password-stdin <<<"$DOCKER_TOKEN"
78+
docker push --all-tags nipy/heudiconv
79+
env:
80+
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
81+
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
82+
83+
# vim:set sts=2:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
venvs/
77
_build/
88
build/
9+
dist/
910
.vscode/
10-

.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
formats: all
3+
python:
4+
install:
5+
- requirements: docs/requirements.txt
6+
- method: pip
7+
path: .
8+
build:
9+
os: ubuntu-20.04
10+
tools:
11+
python: "3"
12+
sphinx:
13+
configuration: docs/conf.py
14+
fail_on_warning: true

0 commit comments

Comments
 (0)