Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
GitHub actions (#14)
Browse files Browse the repository at this point in the history
* Adding a github actions workflow for pushing to testpypi

* Update secret to be env variable

* Fix placing of env

* Moved env to above jobs definition

* Fix typo in poetry config

* Added constraint on tags only

* Added repository testpypi

* Change name to avoid conflict

* change back to datasetinsights

* Setup publish-pypi.yml to point to pypi instead of testpypi

* Fix formatting of publish-pypi.yml

* Adding publish-docker-hub.yml for building and pushing to dockerhub on tags

* Fixed typo in publish-docker-hub.yml.

* Fixed another typo

* Fixed yet another typo

* Changed publish to docker hub to be on release only

* Refactor name of files to have yaml extension and renamed main.yml to linting and unittests. Also added newline to publish-docker-hub.yaml
  • Loading branch information
AdamPalmarUnity authored Aug 4, 2020
1 parent 3b6b6d4 commit 78d7b20
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
File renamed without changes.
18 changes: 18 additions & 0 deletions .github/workflows/publish-docker-hub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
repository: unitytechnologies/datasetinsights
tag_with_ref: true
44 changes: 44 additions & 0 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish to pypi

on:
release:
types: [published]

env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

jobs:

build-and-publish:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Get full Python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Install poetry
shell: bash
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
- name: Set env
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
- name : Configure poetry
shell: bash
run: poetry config pypi-token.pypi $PYPI_TOKEN
- name: Set poetry version
shell: bash
run: poetry version $RELEASE_VERSION
- name: build
shell: bash
run: poetry build
- name: publish
shell: bash
run: poetry publish

0 comments on commit 78d7b20

Please sign in to comment.