@@ -2,8 +2,6 @@ name: Development
22on :
33 pull_request :
44 push :
5- tags :
6- - ' *.*.*'
75jobs :
86 test-changelog :
97 runs-on : ubuntu-latest
4038 - uses : actions/checkout@v2
4139 - name : Compile docs static artifacts
4240 run : |
43- export PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
41+ export PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\" '{print $2}')
4442 export HOST_UID=$(id -u)
4543 docker-compose -f docker-compose-docs.yaml up --exit-code-from pharus-docs --build
4644 echo "PHARUS_VERSION=${PHARUS_VERSION}" >> $GITHUB_ENV
6967 - uses : actions/checkout@v2
7068 - name : Compile image
7169 run : |
72- export PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
70+ export PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\" '{print $2}')
7371 export HOST_UID=$(id -u)
7472 docker-compose -f docker-compose-build.yaml up --exit-code-from pharus --build
7573 IMAGE=$(docker images --filter "reference=datajoint/pharus*" \
@@ -112,7 +110,7 @@ jobs:
112110 - uses : actions/checkout@v2
113111 - name : Determine package version
114112 run : |
115- PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
113+ PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\" '{print $2}')
116114 echo "PHARUS_VERSION=${PHARUS_VERSION}" >> $GITHUB_ENV
117115 - name : Fetch image artifact
118116 uses : actions/download-artifact@v2
@@ -124,7 +122,13 @@ jobs:
124122 docker load < "image-pharus-${PHARUS_VERSION}-py${PY_VER}-${DISTRO}.tar.gz"
125123 docker-compose -f docker-compose-test.yaml up --exit-code-from pharus
126124 publish-release :
127- if : github.event_name == 'push'
125+ if : |
126+ github.event_name == 'push' &&
127+ contains(github.ref, 'refs/tags/*.*.*') &&
128+ (
129+ github.repository_owner == 'datajoint' ||
130+ github.repository_owner == 'vathes'
131+ )
128132 needs : test
129133 runs-on : ubuntu-latest
130134 env :
@@ -136,7 +140,7 @@ jobs:
136140 - uses : actions/checkout@v2
137141 - name : Determine package version
138142 run : |
139- PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
143+ PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\" '{print $2}')
140144 echo "PHARUS_VERSION=${PHARUS_VERSION}" >> $GITHUB_ENV
141145 - name : Get changelog entry
142146 id : changelog_reader
@@ -203,7 +207,13 @@ jobs:
203207 asset_name : docker-compose-deploy.yaml
204208 asset_content_type : application/yaml
205209 publish-images :
206- if : github.event_name == 'push'
210+ if : |
211+ github.event_name == 'push' &&
212+ contains(github.ref, 'refs/tags/*.*.*') &&
213+ (
214+ github.repository_owner == 'datajoint' ||
215+ github.repository_owner == 'vathes'
216+ )
207217 needs : publish-release
208218 runs-on : ubuntu-latest
209219 strategy :
@@ -216,21 +226,23 @@ jobs:
216226 PY_VER : ${{matrix.py_ver}}
217227 DISTRO : ${{matrix.distro}}
218228 IMAGE : ${{matrix.image}}
219- DOCKER_USERNAME : ${{secrets.docker_username}}
220- DOCKER_PASSWORD : ${{secrets.docker_password}}
221229 steps :
222230 - uses : actions/checkout@v2
223231 - name : Determine package version
224232 run : |
225- PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
233+ PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\" '{print $2}')
226234 echo "PHARUS_VERSION=${PHARUS_VERSION}" >> $GITHUB_ENV
227235 - name : Fetch image artifact
228236 uses : actions/download-artifact@v2
229237 with :
230238 name : image-pharus-${{env.PHARUS_VERSION}}-py${{matrix.py_ver}}-${{matrix.distro}}
239+ - name : Login to DockerHub
240+ uses : docker/login-action@v1
241+ with :
242+ username : ${{secrets.docker_username}}
243+ password : ${{secrets.docker_password}}
231244 - name : Publish image
232245 run : |
233- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
234246 docker load < "image-pharus-${PHARUS_VERSION}-py${PY_VER}-${DISTRO}.tar.gz"
235247 IMAGE=$(docker images --filter "reference=datajoint/*" --format "{{.Repository}}")
236248 TAG=$(docker images --filter "reference=datajoint/*" --format "{{.Tag}}")
@@ -253,14 +265,20 @@ jobs:
253265 ${{matrix.distro}}.tar.gz"
254266 asset_content_type : application/gzip
255267 publish-docs :
256- if : github.event_name == 'push'
268+ if : |
269+ github.event_name == 'push' &&
270+ contains(github.ref, 'refs/tags/*.*.*') &&
271+ (
272+ github.repository_owner == 'datajoint' ||
273+ github.repository_owner == 'vathes'
274+ )
257275 needs : publish-release
258276 runs-on : ubuntu-latest
259277 steps :
260278 - uses : actions/checkout@v2
261279 - name : Determine package version
262280 run : |
263- PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
281+ PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\" '{print $2}')
264282 echo "PHARUS_VERSION=${PHARUS_VERSION}" >> $GITHUB_ENV
265283 - name : Fetch docs static artifacts
266284 uses : actions/download-artifact@v2
0 commit comments