1+ name : Python Deploy
2+
3+ on :
4+ release :
5+ types : ["published"]
6+ workflow_dispatch :
7+
8+ env :
9+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
10+ GH_TOKEN : ${{secrets.PAT_TOKEN}}
11+
12+ jobs :
13+
14+ integration_test :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v3
18+ - name : Generate Short SHA and Unique runner id
19+ id : vars
20+ run : |
21+ echo ::set-output name=sha_short::${GITHUB_SHA::7}
22+ echo ::set-output name=uuid::${{ env.BRANCH_NAME }}:${GITHUB_SHA::7}:${GITHUB_RUN_ID}
23+ - name : Trigger Integration tests remote task
24+ id : integration_test_trigger
25+ timeout-minutes : 20
26+ uses : ironSource/action-trigger-workflow@main
27+ with :
28+ owner : ${{ secrets.TRIGGERED_OWNER }}
29+ repo : ${{ secrets.TRIGGERED_REPO }}
30+ github_token : ${{ secrets.PAT_TOKEN }}
31+ workflow_file_name : api-tests-py.yml
32+ job_uuid : " ${{ steps.vars.outputs.uuid }}"
33+ monitored_job_name : test
34+ inputs : ' { "repository": "${{github.repository}}", "branch_name": "${{ env.BRANCH_NAME }}", "user": "${{github.actor}}", "job_uuid": "${{ steps.vars.outputs.uuid }}"}'
35+
36+ - name : Print Integration Tests results
37+ if : failure()
38+ run : |
39+ echo Checking log for workflow ${{steps.integration_test_trigger.outputs.workflow_id}} job ${{steps.integration_test_trigger.outputs.job_id}}
40+ gh --repo ${{ secrets.TRIGGERED_OWNER }}/${{ secrets.TRIGGERED_REPO }} run view --job ${{steps.integration_test_trigger.outputs.job_id}} --log
41+
42+ build :
43+ runs-on : ubuntu-latest
44+ strategy :
45+ max-parallel : 1
46+ matrix :
47+ python-version : [3.8]
48+ needs : integration_test
49+ steps :
50+ - uses : actions/checkout@v3
51+ - name : Set up Python ${{ matrix.python-version }}
52+ uses : actions/setup-python@v4
53+ with :
54+ python-version : ${{ matrix.python-version }}
55+ - name : Install dependencies
56+ run : |
57+ python -m pip install --upgrade pip setuptools wheel build
58+ pip install -r dev_requirements.txt
59+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
60+ - name : Run 📦 creation
61+ run : |
62+ python -m build --sdist
63+ - name : Publish 📦 to Jfrog
64+ uses : pypa/gh-action-pypi-publish@release/v1
65+ with :
66+ password : ${{ secrets.JFROG_PASSWORD }}
67+ user : ${{ secrets.JFROG_USER }}
68+ repository_url : https://ironsrc.jfrog.io/artifactory/api/pypi/pypi-local-release-py3
69+ - name : Archive package
70+ uses : actions/upload-artifact@v2
71+ with :
72+ name : ironsource-api
73+ path : dist
0 commit comments