55 - main
66
77jobs :
8- tag_and_publish :
9- name : Parse version
8+ tag :
9+ name : Tag
10+ uses : AllenNeuralDynamics/.github/.github/workflows/release-tag.yml@main
11+ secrets :
12+ repo-token : ${{ secrets.GITHUB_TOKEN }}
13+ publish-image :
14+ needs : tag
15+ uses : AllenNeuralDynamics/.github/.github/workflows/release-publish-docker-image.yml@main
16+ with :
17+ docker-tag : ${{ needs.tag.outputs.new_version }}
18+ secrets :
19+ repo-token : ${{ secrets.GITHUB_TOKEN }}
20+ publish-pypi :
21+ needs : tag
1022 runs-on : ubuntu-latest
11- outputs :
12- pkg_version : ${{ steps.output_version.outputs.pkg_version }}
1323 steps :
14- - uses : actions/checkout@v4
15- - name : Get version from file
16- run : |
17- pkg_name=$(grep -P 'version = \{attr = .*\}' pyproject.toml | grep -oP '\w+.__version__')
18- init_file="./src/${pkg_name//.__version__}/__init__.py"
19- pkg_version=$(grep -Po '[0-9]+\.[0-9]+\.[0-9]+' "$init_file")
20- echo "docker_tag=$pkg_version" >> "$GITHUB_ENV"
21- - name : Create git tag
22- run : |
23- git tag "v${{ env.docker_tag }}"
24- - name : Push git tag
25- run : git push origin "v${{ env.docker_tag }}"
26- - name : Set up Docker Buildx
27- id : buildx
28- uses : docker/setup-buildx-action@v2
29- - name : Login to Github Packages
30- uses : docker/login-action@v2
31- with :
32- registry : ghcr.io
33- username : ${{ github.actor }}
34- password : ${{ secrets.GITHUB_TOKEN }}
35- - name : Build image and push to GitHub Container Registry
36- uses : docker/build-push-action@v3
37- with :
38- # relative path to the place where source code with Dockerfile is located
39- context : .
40- push : true
41- tags : |
42- ghcr.io/allenneuraldynamics/aind-data-transfer-service:${{ env.docker_tag }}
43- ghcr.io/allenneuraldynamics/aind-data-transfer-service:latest
24+ - name : Checkout repository
25+ uses : actions/checkout@v5
4426 - name : Set up Python 3.10
4527 uses : actions/setup-python@v5
4628 with :
5335 - name : Publish on PyPI
5436 uses : pypa/gh-action-pypi-publish@release/v1.12
5537 with :
56- password : ${{ secrets.AIND_PYPI_TOKEN }}
38+ password : ${{ secrets.AIND_PYPI_TOKEN }}
0 commit comments