This repository was archived by the owner on Jul 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.98 KB
/
release.yml
File metadata and controls
69 lines (57 loc) · 1.98 KB
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
name: release
on:
push:
tags:
- "*"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Fetch tags and master for GitVersion
run: |
git fetch --tags
git branch --create-reflog master origin/master
- name: Install GitVersion
uses: gittools/use-gitversion/setup@v0.2
with:
versionSpec: "5.1.x"
- name: Use GitVersion
id: gitversion
uses: gittools/use-gitversion/execute@v0.2
- run: |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
- name: Replace tokens
uses: cschleiden/replace-tokens@v1.0
with:
files: mycloud/__init__.py
env:
GitVersion: ${{ steps.gitversion.outputs.majorMinorPatch }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.7"
- name: "Install myCloud CLI"
run: python setup.py install
- name: "Run tests"
run: pip install pytest && python -m pytest
- name: Publish Docker
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
docker login -u="$DOCKERHUB_USERNAME" -p="$DOCKERHUB_PASSWORD"
docker image build -t thomasgassmann/mycloud-cli:latest -t thomasgassmann/mycloud-cli:${{ steps.gitversion.outputs.majorMinorPatch }} .
docker push thomasgassmann/mycloud-cli:latest
docker push thomasgassmann/mycloud-cli:${{ steps.gitversion.outputs.majorMinorPatch }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*