-
Notifications
You must be signed in to change notification settings - Fork 10
72 lines (63 loc) · 2.08 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Create a release
on:
push:
branches:
- main
workflow_run:
workflows: [test, lint]
types:
- completed
jobs:
generate-release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.TAG_CREATOR_API_TOKEN }}
outputs:
version: ${{ steps.release.outputs.version }}
steps:
- id: release
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: norelease
push-release:
if: needs.generate-release.outputs.version != ''
runs-on: ubuntu-latest
needs: generate-release
steps:
- name: Checkout repo
uses: actions/[email protected]
with:
ref: ${{ github.ref }}
token: ${{ secrets.TAG_CREATOR_API_TOKEN }}
- name: Setup python
uses: actions/[email protected]
with:
python-version: "3.10"
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Update poetry version
run: |
poetry version ${{ needs.generate-release.outputs.version }}
- name: Commit poetry version
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Poetry version updated
file_pattern: pyproject.toml
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
python_version: "3.10"
# following 2 lines set deployment to testpypi
# repository_name: "testpypi"
# repository_url: "https://test.pypi.org/legacy/"
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the neurotechdevkit docker image
run: |
docker build . --tag ghcr.io/agencyenterprise/neurotechdevkit:latest --tag ghcr.io/agencyenterprise/neurotechdevkit:${{ needs.generate-release.outputs.version }}
docker push --all-tags ghcr.io/agencyenterprise/neurotechdevkit