-
-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (55 loc) · 1.65 KB
/
pre-release.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
name: pre-release
on:
workflow_dispatch:
push:
branches:
- main
- '!stable'
- '!release'
env:
VERSION: 1.0.dev${{ github.run_number }}
jobs:
pre-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Update Version
shell: pwsh
run: |
$initFile = 'setup.py'
$line = Get-Content $initFile | Select-String 'version=' | Select-Object -ExpandProperty Line
if ($line -ne $null) {
$content = Get-Content $initFile
$content | ForEach-Object {$_ -replace $line, " version='${{ env.VERSION }}',"} | Set-Content $initFile
}
Get-Content $initFile | Write-Host
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
test-linux:
needs: pre-release
uses: christianhelle/autofaker/.github/workflows/test.yml@main
with:
os: ubuntu-latest
test-mac:
needs: pre-release
uses: christianhelle/autofaker/.github/workflows/test.yml@main
with:
os: macos-latest
test-windows:
needs: pre-release
uses: christianhelle/autofaker/.github/workflows/test.yml@main
with:
os: windows-latest