-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update github action pipeline to push to Pypi without release
- Loading branch information
1 parent
5344213
commit a52bc2d
Showing
2 changed files
with
59 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,86 @@ | ||
name: Publish to PyPI | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- ".github/workflows/publish.yml" | ||
- "aws_fusion/**" | ||
- "setup.py" | ||
|
||
concurrency: publish | ||
|
||
env: | ||
PYTHON_VERSION: '3.11' | ||
|
||
jobs: | ||
build: | ||
tagging: | ||
runs-on: ubuntu-latest | ||
name: Auto Tagging | ||
permissions: | ||
contents: write | ||
outputs: | ||
tag: ${{ steps.package_info.outputs.tag }} | ||
tag_pre_exist: ${{ steps.package_info.outputs.tag_pre_exist }} | ||
steps: | ||
- name: Checkout 🔔 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Get package information | ||
id: package_info | ||
run: | | ||
current_version=$(./setup.py --version) | ||
tag_pre_exist=false | ||
if git rev-parse "refs/tags/v$current_version" >/dev/null 2>&1; then | ||
echo "::warning title=Tag already exists::v${current_version}" | ||
tag_pre_exist=true | ||
fi | ||
echo "tag=v${current_version}" >> "$GITHUB_OUTPUT" | ||
echo "tag_pre_exist=${tag_pre_exist}" >> "$GITHUB_OUTPUT" | ||
- name: Add git tag | ||
if: ${{ steps.package_info.outputs.tag_pre_exist == 'false' }} | ||
run: | | ||
git tag ${{ steps.package_info.outputs.tag }} | ||
git push origin ${{ steps.package_info.outputs.tag }} | ||
publish: | ||
needs: tagging | ||
if: ${{ needs.tagging.outputs.tag_pre_exist == 'false' }} | ||
runs-on: ubuntu-latest | ||
name: Publish | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Checkout code | ||
- name: Checkout 🔔 | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ needs.tagging.outputs.tag }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish release distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file was deleted.
Oops, something went wrong.