1on:
2  push:
3    branches:
4      - main
5      - v*-branch
6
7name: imgtool
8
9concurrency:
10  group: imgtool-${{ github.event.pull_request.number || github.ref }}
11  cancel-in-progress: true
12
13jobs:
14  environment:
15    runs-on: ubuntu-latest
16    steps:
17    - uses: actions/checkout@v2
18      with:
19        fetch-depth: 0
20    - name: Cache pip
21      uses: actions/cache@v1
22      with:
23        path: ~/.cache/pip
24        key: ${{ runner.os }}-pip
25    - name: Install packages
26      run: |
27        export PATH="$HOME/.local/bin:$PATH"
28        ./ci/imgtool_install.sh
29    - name: Publish
30      env:
31        TWINE_TOKEN: ${{ secrets.TWINE_TOKEN }}
32      run: |
33        export PATH="$HOME/.local/bin:$PATH"
34        ./ci/imgtool_run.sh
35