Skip to content

Commit

Permalink
[UPD] update ci-cd
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar1854 committed Jun 2, 2024
1 parent 99d2f8b commit f796d42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 49 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- "**"
- "!main"
pull_request:
branches: main

Expand Down
53 changes: 4 additions & 49 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ name: Publish RetailTree Python package distribution to PyPI

on:
push:
paths:
- "setup.py"
branches:
- main
workflow_run:
workflows: ["Run Tests"]
types:
- completed
- "main"

jobs:
build:
Expand Down Expand Up @@ -37,7 +35,7 @@ jobs:
publish-to-pypi:
name: >-
Publish RetailTree Python package distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
Expand All @@ -55,46 +53,3 @@ jobs:
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'

0 comments on commit f796d42

Please sign in to comment.