|
7 | 7 | - pre-commit-ci-update-config
|
8 | 8 | workflow_dispatch:
|
9 | 9 |
|
10 |
| -jobs: |
11 |
| - wait-tests: |
12 |
| - name: Wait for tests |
13 |
| - runs-on: ubuntu-latest |
| 10 | +env: |
| 11 | + DEFAULT_PYTHON: '3.11' |
14 | 12 |
|
15 |
| - steps: |
16 |
| - - uses: fountainhead/[email protected] |
17 |
| - id: wait-for-tests |
18 |
| - with: |
19 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
20 |
| - checkName: Tests done |
21 |
| - ref: ${{ github.sha }} |
22 |
| - timeoutSeconds: 3600 |
23 |
| - |
24 |
| - - name: Fail the Build |
25 |
| - uses: cutenode/action-always-fail@v1 |
26 |
| - if: steps.wait-for-tests.outputs.conclusion != 'success' |
27 |
| - |
28 |
| - wait-codeql: |
29 |
| - name: Wait for CodeQL |
30 |
| - runs-on: ubuntu-latest |
31 |
| - |
32 |
| - steps: |
33 |
| - - uses: fountainhead/[email protected] |
34 |
| - id: wait-for-codeql |
35 |
| - with: |
36 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
37 |
| - checkName: Analyze |
38 |
| - ref: ${{ github.sha }} |
39 |
| - timeoutSeconds: 3600 |
40 |
| - |
41 |
| - - name: Fail the Build |
42 |
| - uses: cutenode/action-always-fail@v1 |
43 |
| - if: steps.wait-for-codeql.outputs.conclusion != 'success' |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 15 | + cancel-in-progress: true |
44 | 16 |
|
| 17 | +jobs: |
45 | 18 | release:
|
46 | 19 | name: Release package
|
47 | 20 | runs-on: ubuntu-latest
|
48 |
| - needs: [wait-tests, wait-codeql] |
| 21 | + if: github.repository == 'dolfinus/setuptools-git-versioning' # prevent running on forks |
| 22 | + |
| 23 | + environment: |
| 24 | + name: test-pypi |
| 25 | + url: https://test.pypi.org/p/onetl |
| 26 | + permissions: |
| 27 | + id-token: write # to auth in Test PyPI |
49 | 28 |
|
50 | 29 | steps:
|
51 | 30 | - name: Checkout code
|
52 | 31 | uses: actions/checkout@v3
|
53 | 32 | with:
|
54 | 33 | fetch-depth: 0
|
55 | 34 |
|
56 |
| - - name: Set up Python 3.11 |
| 35 | + - name: Set up Python ${{ env.DEFAULT_PYTHON }} |
| 36 | + id: python |
57 | 37 | uses: actions/setup-python@v4
|
58 | 38 | with:
|
59 |
| - python-version: '3.11' |
| 39 | + python-version: ${{ env.DEFAULT_PYTHON }} |
60 | 40 |
|
61 | 41 | - name: Cache pip
|
62 | 42 | uses: actions/cache@v3
|
63 | 43 | with:
|
64 | 44 | path: ~/.cache/pip
|
65 |
| - key: ${{ runner.os }}-python-3.11-release-${{ hashFiles('requirements*.txt') }} |
| 45 | + key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} |
66 | 46 | restore-keys: |
|
67 |
| - ${{ runner.os }}-python-3.11-release-${{ hashFiles('requirements*.txt') }} |
68 |
| - ${{ runner.os }}-python-3.11-release- |
| 47 | + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} |
| 48 | + ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release- |
69 | 49 | ${{ runner.os }}-python
|
70 | 50 | ${{ runner.os }}-
|
71 | 51 |
|
|
88 | 68 | - name: Publish package
|
89 | 69 | uses: pypa/gh-action-pypi-publish@release/v1
|
90 | 70 | with:
|
91 |
| - password: ${{ secrets.TEST_PYPI_API_TOKEN }} |
92 | 71 | repository_url: https://test.pypi.org/legacy/
|
0 commit comments