-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (75 loc) · 2.88 KB
/
dev.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This is a basic workflow to help you get started with Actions
name: dev build CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events
push:
branches:
- "dev*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
# The type of runner that the job will run on
strategy:
matrix:
python-versions: ["3.10"]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
# map step outputs to job outputs so they can be share among jobs
outputs:
package_version: ${{ steps.variables_step.outputs.package_version }}
package_name: ${{ steps.variables_step.outputs.package_name }}
repo_name: ${{ steps.variables_step.outputs.repo_name }}
repo_owner: ${{ steps.variables_step.outputs.repo_owner }}
# uncomment the following to pickup services
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-versions }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions poetry
# declare package_version, repo_owner, repo_name, package_name so you may use it in web hooks.
- name: Declare variables for convenient use
id: variables_step
run: |
echo "::set-output name=repo_owner::${GITHUB_REPOSITORY%/*}"
echo "::set-output name=repo_name::${GITHUB_REPOSITORY#*/}"
echo "::set-output name=package_name::`poetry version | awk '{print $1}'`"
echo "::set-output name=package_version::`poetry version --short`"
shell: bash
- name: test with tox
run: tox
publish_dev_build:
# if test failed, we should not publish
needs: test
# you may need to change os below
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry tox tox-gh-actions
- name: Build wheels and source tarball
run: |
poetry version $(poetry version --short)-dev.$GITHUB_RUN_NUMBER
poetry lock
poetry build
- name: publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true