File tree Expand file tree Collapse file tree 1 file changed +24
-8
lines changed Expand file tree Collapse file tree 1 file changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -27,17 +27,33 @@ jobs:
27
27
run : |
28
28
# python -m pip install --upgrade pip
29
29
pip install hatch
30
-
31
30
- name : Build package
32
31
run : hatch build
33
-
34
32
- name : Test package
35
33
run : hatch -e test run nose2 --verbose
36
-
37
34
- name : Publish package distributions to Test PyPI
38
- env :
39
- HATCH_INDEX_USER : __token__ # Use '__token__' as the username
40
- HATCH_INDEX_AUTH : ${{ secrets.PYPI_APIKEY }} # PyPI API token stored as a secret
35
+ if : github.ref != 'refs/heads/master'
36
+ uses : pypa/gh-action-pypi-publish@release/v1
37
+ with :
38
+ skip-existing : true
39
+ repository-url : https://test.pypi.org/legacy/
40
+ - name : Publish package distributions to PyPI
41
+ if : github.ref == 'refs/heads/master'
42
+ uses : pypa/gh-action-pypi-publish@release/v1
43
+ with :
44
+ skip-existing : true
45
+ repository-url : https://upload.pypi.org/legacy/
46
+ container-build :
47
+ runs-on : ubuntu-latest
48
+ steps :
49
+ - uses : actions/checkout@v4
50
+ - run : echo version ${{needs.version.outputs.app-version}}
51
+ - run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
52
+ - name : build & push image
41
53
run : |
42
- hatch build
43
- hatch publish
54
+ version=$( cat calrissian/__about__.py | cut -d "=" -f 2 | tr -d '"' )
55
+ IMAGE_ID=ghcr.io/duke-gcb/calrissian/calrissian
56
+ docker build . --file Dockerfile --tag calrissian
57
+ docker tag calrissian $IMAGE_ID:$version
58
+ docker push $IMAGE_ID:$version
59
+
You can’t perform that action at this time.
0 commit comments