Skip to content

Merge branch 'main' into release #19

Merge branch 'main' into release

Merge branch 'main' into release #19

Workflow file for this run

name: release
on:
workflow_dispatch:
push:
branches:
- 'release'
env:
VERSION: 1.0.${{ github.run_number }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
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 PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ env.VERSION }}",
sha: context.sha
})
test-linux:
needs: release
uses: christianhelle/autofaker/.github/workflows/test.yml@main
with:
os: ubuntu-latest
use-test-pypi: false
test-mac:
needs: release
uses: christianhelle/autofaker/.github/workflows/test.yml@main
with:
os: macos-latest
use-test-pypi: false
test-windows:
needs: release
uses: christianhelle/autofaker/.github/workflows/test.yml@main
with:
os: windows-latest
use-test-pypi: false