Skip to content

Commit 0775d4c

Browse files
committed
Python publish with github
1 parent 43c7566 commit 0775d4c

File tree

4 files changed

+34
-21
lines changed

4 files changed

+34
-21
lines changed

src/SDK/Language/Python.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ public function getFiles(): array
202202
],
203203
[
204204
'scope' => 'default',
205-
'destination' => '.travis.yml',
206-
'template' => 'python/.travis.yml.twig',
205+
'destination' => '.github/workflows/publish.yml',
206+
'template' => 'python/.github/workflows/publish.yml.twig',
207207
],
208208
[
209209
'scope' => 'enum',
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
name: Release build and publish
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.8'
18+
19+
- name: Build package
20+
run: |
21+
python -m pip install setuptools wheel build
22+
python setup.py sdist bdist_wheel
23+
24+
- name: Publish package
25+
run: |
26+
python -m pip install twine
27+
python -m twine upload -r pypi dist/*
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: {{ '${{ secrets.PYPI_TOKEN }}' }}
31+
TWINE_NON_INTERACTIVE: true

templates/python/.travis.yml.twig

Lines changed: 0 additions & 18 deletions
This file was deleted.

templates/ruby/.github/workflows/publish.yml.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- name: Set up RubyGems
2121
run: |
22-
cat "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials
22+
cat "---\n:rubygems_api_key: {{ '${{ secrets.RUBYGEMS_TOKEN }}' }}\n" > ~/.gem/credentials
2323
chmod 0600 ~/.gem/credentials
2424

2525
- name: Build gem

0 commit comments

Comments
 (0)