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

Commit 78d7b20

Browse files
GitHub actions (#14)
* 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
1 parent 3b6b6d4 commit 78d7b20

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed
File renamed without changes.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish Docker image
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
push_to_registry:
7+
name: Push Docker image to Docker Hub
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out the repo
11+
uses: actions/checkout@v2
12+
- name: Push to Docker Hub
13+
uses: docker/build-push-action@v1
14+
with:
15+
username: ${{ secrets.DOCKERHUB_USERNAME }}
16+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
17+
repository: unitytechnologies/datasetinsights
18+
tag_with_ref: true

.github/workflows/publish-pypi.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to pypi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
9+
10+
jobs:
11+
12+
build-and-publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
17+
- uses: actions/checkout@v2
18+
- name: Set up Python 3.8
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
- name: Get full Python version
23+
id: full-python-version
24+
shell: bash
25+
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
26+
- name: Install poetry
27+
shell: bash
28+
run: |
29+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
30+
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
31+
- name: Set env
32+
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
33+
- name : Configure poetry
34+
shell: bash
35+
run: poetry config pypi-token.pypi $PYPI_TOKEN
36+
- name: Set poetry version
37+
shell: bash
38+
run: poetry version $RELEASE_VERSION
39+
- name: build
40+
shell: bash
41+
run: poetry build
42+
- name: publish
43+
shell: bash
44+
run: poetry publish

0 commit comments

Comments
 (0)