|
34 | 34 | - name: Run linters |
35 | 35 | run: | |
36 | 36 | make lint |
| 37 | +
|
| 38 | + info: |
| 39 | + name: Prepare release |
| 40 | + runs-on: ubuntu-latest |
| 41 | + needs: [lint] |
| 42 | + timeout-minutes: 5 |
| 43 | + outputs: |
| 44 | + version: ${{ steps.version.outputs.version }} |
| 45 | + name: ${{ steps.version.outputs.name }} |
| 46 | + steps: |
| 47 | + - name: Checkout commit |
| 48 | + uses: actions/checkout@v2 |
| 49 | + with: |
| 50 | + ref: ${{ github.event.workflow_run.head_sha }} |
| 51 | + fetch-depth: 0 |
| 52 | + - name: Setup Python 3.9 |
| 53 | + uses: actions/setup-python@v2 |
| 54 | + with: |
| 55 | + python-version: '3.9' |
| 56 | + - name: Cache PyPI |
| 57 | + |
| 58 | + with: |
| 59 | + key: pip-lint-${{ hashFiles('requirements/*.txt') }} |
| 60 | + path: ~/.cache/pip |
| 61 | + restore-keys: | |
| 62 | + pip-lint- |
| 63 | + - name: Install dependencies |
| 64 | + run: | |
| 65 | + python -m pip install pip |
| 66 | + make setup |
| 67 | + - name: Save the package version |
| 68 | + id: version |
| 69 | + run: | |
| 70 | + echo "::set-output name=version::$(python setup.py --version)" |
| 71 | + echo "::set-output name=name::$(python setup.py --name)" |
| 72 | + - name: Show version |
| 73 | + run: | |
| 74 | + echo ${{ steps.version.outputs.name }}==${{ steps.version.outputs.version }} |
| 75 | +
|
| 76 | + build_image: |
| 77 | + name: Build image |
| 78 | + runs-on: ubuntu-latest |
| 79 | + needs: [info] |
| 80 | + steps: |
| 81 | + - name: Purge old artifacts |
| 82 | + uses: kolpav/purge-artifacts-action@v1 |
| 83 | + with: |
| 84 | + token: ${{ secrets.GH_TOKEN }} |
| 85 | + expire-in: 30mins |
| 86 | + - name: Checkout commit |
| 87 | + uses: actions/checkout@v2 |
| 88 | + with: |
| 89 | + ref: ${{ github.event.workflow_run.head_sha }} |
| 90 | + fetch-depth: 0 |
| 91 | + - name: Build release image |
| 92 | + run: | |
| 93 | + docker build -t ${{ needs.info.outputs.name }} . |
| 94 | + - name: Store image in run's artifacts |
| 95 | + |
| 96 | + with: |
| 97 | + image: ${{ needs.info.outputs.name }} |
| 98 | + token: ${{ secrets.GH_TOKEN }} |
0 commit comments