Create a release #1167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |