Skip to content

chore(ci): add release environment #114

chore(ci): add release environment

chore(ci): add release environment #114

Workflow file for this run

# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Release plugp100
on:
workflow_dispatch:
inputs:
skip_pypi_publish:
description: 'Skip PyPI publish'
default: 'false'
required: false
push:
branches:
- main
- next
- dev
# tags:
# - v*.*.*
jobs:
# build_vendoring_wheels:
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# runs-on: ubuntu-latest
# name: Build on ${{ matrix.platform }} with ${{ matrix.python }}
#
# strategy:
# matrix:
# platform:
# - manylinux2014_aarch64
# - musllinux_1_1_aarch64
# - manylinux2014_armv7l
# python: [ python3.9, python3.10 ]
#
# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# - name: Build wheels for ${{ matrix.python }} on ${{ matrix.platform }}
# uses: ./.github/actions/python-on-arch
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# arch: ${{ matrix.platform }}
# python: ${{ matrix.python }}
# run: |
# ${{ matrix.python }} --version
# echo "Generate vendoring wheel..."
# ${{ matrix.python }} build_tools/build_vendoring.py ./plugp100/_vendor ./.cache-pip
# echo "Generate library wheel with the right platform name"
# ${{ matrix.python }} build_tools/build_platform_wheel.py ./plugp100/_vendor requirements.txt
# ${{ matrix.python }} build_tools/rename_wheels.py ${{ matrix.platform }}
# - name: "Upload generated wheel for ${{ matrix.python }} ${{ matrix.platform }}"
# uses: actions/upload-artifact@v3
# with:
# name: wheel
# path: dist/*
publish_pypi:
name: Publish to PyPi
runs-on: ubuntu-latest
environment: release
# needs: [ build_vendoring_wheels ]
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
token: ${{ secrets.GIT_GITHUB_TOKEN }}
persist-credentials: false
- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Semantic Release (Dry Run)
id: semantic
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'next', prerelease: true}, {name: 'dev', channel: 'dev', prerelease: true} ]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN }}
- name: Bump version file
run: sed -i 's/__version__ = ".*"/__version__ = \"${{ steps.semantic.outputs.new_release_version }}\"/g' plugp100/__init__.py
- name: Generating Any and Source Distribution
run: |
python setup.py sdist bdist_wheel
ls -R
- name: Publish source distribution to PyPi
if: ${{ github.event.inputs.skip_pypi_publish != 'true' }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'next', prerelease: true}, {name: 'dev', channel: 'dev', prerelease: true}]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN }}