Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #80 from TaykYoku/integration_addDeployment
Browse files Browse the repository at this point in the history
[v1r3] add deployment action (py2/py3)
  • Loading branch information
TaykYoku authored Dec 14, 2021
2 parents ef57282 + 070ffbc commit 8226fe3
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deployment

on:
push:
tags:
- v1r[0-9]+
pull_request:

jobs:
deploy-pypi:
name: PyPI deployment
runs-on: "ubuntu-latest"
if: github.event_name != 'push' || github.repository == 'DIRACGrid/COMDIRAC'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: pip install build readme_renderer diraccfg
- name: Validate README for PyPI
run: python -m readme_renderer README.* -o /tmp/README.html
- name: Make PEP-440 style release on GitHub
id: PEP-440
if: github.event_name == 'push'
run: |
TAG_NAME=${GITHUB_REF##*/}
NEW_STYLE=$(python -c "import diraccfg; major, minor, patch, pre = diraccfg.parseVersion('${TAG_NAME}'); print(f'{major}.{minor}.{patch}', f'a{pre}' if pre else '', sep='')")
echo "Converted ${TAG_NAME} version to ${NEW_STYLE}"
echo ::set-output name=tag_name::"v$NEW_STYLE"
echo ::set-output name=target_commitish::"$(git rev-parse HEAD)"
- name: Publish ${{ steps.PEP-440.outputs.tag_name }} release to GitHub
if: github.event_name == 'push'
uses: softprops/action-gh-release@v1
with:
target_commitish: ${{ steps.PEP-440.outputs.target_commitish }}
body_path: release.notes
tag_name: ${{ steps.PEP-440.outputs.tag_name }}
- name: Get ${{ steps.PEP-440.outputs.tag_name }} tag
if: github.event_name == 'push'
uses: actions/checkout@v2
with:
ref: ${{ steps.PEP-440.outputs.tag_name }}
- name: Build distributions
run: python -m build
- name: Publish package on PyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 8226fe3

Please sign in to comment.