Skip to content

Commit 0674088

Browse files
committed
Build pypi package using github actions to avoid maintaining pypi encrypted secret in repo
1 parent e57923b commit 0674088

File tree

2 files changed

+39
-8
lines changed

2 files changed

+39
-8
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package to PyPi
10+
11+
on:
12+
release:
13+
types: [published]
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
env:
18+
BOTO_CONFIG: /dev/null
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: '3.x'
25+
- name: Build package
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build
29+
- name: Freeze requirements.txt
30+
run: bash build_scripts/freeze_requirements.sh
31+
- name: Build package
32+
run: python -m build
33+
- name: Test package
34+
run: pip install --no-cache-dir dist/ops*.tar.gz && ops --verbose -h
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.ADOBE_BOT_PYPI_TOKEN }}

.travis.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ script:
1717
- bash build_scripts/build_package.sh
1818
# dry run
1919
- pip install --no-cache-dir dist/ops*.tar.gz && ops --verbose -h
20-
2120
# Output something every 5 minutes or Travis kills the job
2221
- while sleep 5m; do echo "=====[ $SECONDS seconds still running ]====="; done &
2322
# build docker image
@@ -28,13 +27,6 @@ script:
2827
before_deploy:
2928
- git add requirements.txt
3029
deploy:
31-
- provider: pypi
32-
skip_cleanup: true
33-
user: adobe
34-
password:
35-
secure: lRjP7ej0IeJilu8JedGfKS9an9JZNGLYG6ODdMbfJODblvEWzImjBkHXUeVAJ7YVmppT2kv5f2zGfrO2JiFUVevnlvlbRU0owQf2kCRIeDmafqqHk9WwdsWuOHDbRZ5zE+hkP7dQh3XG4OM3f9//9CI0gk19AkZs5d76aFrDgjkIAMMV7aMw2gz7blkHU/n7ZKRdcLzsdFOFrSS507kiI1x3NTGgzCU+1jYqds6JLLVJMXCVlSlxQV9SkP3HcvE+JIVQ9UfsuwwoFFFAOm/tEYmJAMIeOhIbCNcXYRdwRHByoEuG3OHIChLKfPpf+c47G1oReFPtSmZVbYHdkr3gPoKU05X0zbNY8lN/biuYq6ykp0nB6+swst3kG/l4HRx5WaCtPDB6TefTzFtIvwETuAKdFq6UoB1sSgu3GAK2hucFPsKYLEXPct2i8O3GAtgUrT5VSPgx9oEk9fNqhonP2kC95yEiBeRdZ7ZdqWdFKApQccBmrncp/vRVPDKAlGWiVg22yPYbbxgW/f7qX2vvCqc9BUJFsgv4FfInHWhfWA6pX6slNIEj/92g8ecBGBDPGTojIAZ2GpU6DFzlGMhNQWQm7XJaq/s/E6ZaUfi9JkT3MmEX5YZ+01yh2ovQR1wq/ZyxdUkQS1DBvrk8sIV8ZUFurpNV8uILUtLr8eJUyUs=
36-
on:
37-
tags: true
3830
- provider: releases
3931
skip_cleanup: true
4032
api_key: "$GITHUB_API_KEY"

0 commit comments

Comments
 (0)