mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2025-12-06 06:26:51 +00:00
Merge pull request #28 from thousandeyes/CP-1897-Action
CP-1897 Release action
This commit is contained in:
commit
bb15037180
50
.github/workflows/release.yaml
vendored
50
.github/workflows/release.yaml
vendored
@ -1 +1,51 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
set-package-matrix:
|
||||
# This action returns all sub-packages to be published.
|
||||
# It thens exports the variable to matrix, so that the deployment job is run individually for each sub-package
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
packages: ${{ steps.packages.outputs.packages }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- id: packages
|
||||
run: |
|
||||
FOLDERS_JSON=$(find . -maxdepth 1 -type d -name "thousandeyes-sdk-*" | cut -c 3- | jq -R -s -c 'split("\n")[:-1]')
|
||||
echo "packages=$FOLDERS_JSON" >> "$GITHUB_OUTPUT"
|
||||
deployment:
|
||||
if: github.event.pull_request.merged == true
|
||||
needs: set-package-matrix
|
||||
strategy:
|
||||
matrix:
|
||||
package-name: ${{ fromJSON(needs.set-package-matrix.outputs.packages) }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
environment:
|
||||
name: release
|
||||
url: https://pypi.org/p/${{ matrix.package-name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
cache: pip
|
||||
cache-dependency-path: '**/pyproject.toml'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install setuptools wheel build
|
||||
- name: Build
|
||||
run: |
|
||||
echo $GITHUB_REF_NAME >> ${{ matrix.package-name }}/.version
|
||||
cp LICENSE NOTICE ${{ matrix.package-name }}/
|
||||
python -m build ${{ matrix.package-name }} --outdir dist/
|
||||
- name: Publish
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
skip-existing: true
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user