Skip to content

Commit

Permalink
custom action
Browse files Browse the repository at this point in the history
  • Loading branch information
JungleCatSW committed Nov 17, 2023
1 parent 979d875 commit 14808c7
Showing 1 changed file with 58 additions and 42 deletions.
100 changes: 58 additions & 42 deletions .github/workflows/workflow-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,66 @@ name: Publish package to TestPyPI
on: push

jobs:
build:
name: Build distribution
generate:
name: Generate
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
- uses: actions/checkout@v4
- name: Run Swagger Codegen
- uses: ./.github/actions/swagger-codegen
with:
language: python
input: swagger/public.swagger.json
action: generate

publish-to-testpypi:
name: Publish to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/cudo-compute

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# build:
# name: Build distribution
# needs:
# - generate
# runs-on: ubuntu-latest
#
# steps:
## - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.x"
# - name: Install pypa/build
# run: >-
# python3 -m
# pip install
# build
# --user
# - name: Build a binary wheel and a source tarball
# run: python3 -m build
# - name: Store the distribution packages
# uses: actions/upload-artifact@v3
# with:
# name: python-package-distributions
# path: dist/
#
# publish-to-testpypi:
# name: Publish to TestPyPI
# needs:
# - build
# runs-on: ubuntu-latest
#
# environment:
# name: testpypi
# url: https://test.pypi.org/p/cudo-compute
#
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
#
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v3
# with:
# name: python-package-distributions
# path: dist/
# - name: Publish distribution to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/

0 comments on commit 14808c7

Please sign in to comment.