Skip to content

Commit

Permalink
Release package to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekmj303 committed Oct 12, 2024
1 parent f7fe16e commit 2705c70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on: push

jobs:
build:
name: >-
Build and Package 📦
if: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/release' }}
strategy:
matrix:
Expand Down Expand Up @@ -76,16 +78,16 @@ jobs:
build/*.app/**/*
overwrite: true

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/ytm2spt

name: pypi
url: https://pypi.org/p/ytm2spt
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand All @@ -95,15 +97,15 @@ jobs:
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/


release:
name: >-
Create a GitHub Release 🚀
needs:
- build
- publish-to-testpypi
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
Expand Down Expand Up @@ -134,25 +136,25 @@ jobs:
- name: Zip Windows Executable
run: |
cd *windows-build
zip -9 ytm2spt-${{ github.ref_name }}-windows.zip *-installer.exe
zip -9 ytm2spt-windows.zip *-installer.exe
- name: Zip Linux Executable
run: |
cd *linux-build
tar -cavf ytm2spt-${{ github.ref_name }}-linux.tar.gz *.bin
tar -cavf ytm2spt-linux.tar.gz *.bin
- name: Zip MacOS Executable
run: |
cd *macos-build
zip -r -9 ytm2spt-${{ github.ref_name }}-macos.zip *.app
zip -r -9 ytm2spt-macos.zip *.app
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
draft: true
generate_release_notes: true
files: |
*build/ytm2spt-${{ github.ref_name }}-windows.zip
*build/ytm2spt-${{ github.ref_name }}-linux.tar.gz
*build/ytm2spt-${{ github.ref_name }}-macos.zip
*build/ytm2spt-windows.zip
*build/ytm2spt-linux.tar.gz
*build/ytm2spt-macos.zip
dist/*
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ytm2spt"
version = "1.0.3-rc1"
version = "1.1.0"
authors = [
{ name="Abhishek M J", email="[email protected]" },
]
Expand Down

0 comments on commit 2705c70

Please sign in to comment.