|
14 | 14 | env: |
15 | 15 | python_version: "3.11" |
16 | 16 |
|
| 17 | +defaults: |
| 18 | + run: |
| 19 | + shell: 'bash --noprofile --norc -Eeuo pipefail {0}' |
| 20 | + |
17 | 21 | jobs: |
18 | 22 | lint: |
19 | 23 | name: Lint |
20 | | - runs-on: ubuntu-20.04 |
| 24 | + runs-on: ubuntu-22.04 |
21 | 25 | steps: |
22 | 26 | - name: Checkout the repository |
23 | 27 | uses: actions/checkout@v3 |
|
29 | 33 | disable_mypy: true |
30 | 34 | test: |
31 | 35 | name: Test |
32 | | - runs-on: ubuntu-20.04 |
| 36 | + runs-on: ubuntu-22.04 |
33 | 37 | steps: |
34 | 38 | - name: Checkout the repository |
35 | 39 | uses: actions/checkout@v3 |
|
62 | 66 | - name: Install Task |
63 | 67 | uses: arduino/setup-task@v1 |
64 | 68 | - name: Initialize the repo |
65 | | - run: task init |
| 69 | + run: task -v init |
| 70 | + - name: Validate the repo |
| 71 | + run: task -v validate |
| 72 | + - name: Set up QEMU for cross-platform emulation |
| 73 | + uses: docker/setup-qemu-action@v2 |
66 | 74 | - name: Run the tests |
67 | | - run: task test |
| 75 | + run: task -v test |
| 76 | + bump-version: |
| 77 | + name: Bump version |
| 78 | + needs: [lint, test] |
| 79 | + if: "${{ github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'Bump version: 2') }}" |
| 80 | + permissions: |
| 81 | + contents: write |
| 82 | + runs-on: ubuntu-22.04 |
| 83 | + outputs: |
| 84 | + tag: ${{ steps.bump-version.outputs.tag }} |
| 85 | + steps: |
| 86 | + - name: Checkout the repository |
| 87 | + uses: actions/checkout@v3 |
| 88 | + with: |
| 89 | + token: ${{ secrets.SEISO_AUTOMATION_PAT }} |
| 90 | + fetch-depth: 0 |
| 91 | + - name: Setup python |
| 92 | + uses: actions/setup-python@v4 |
| 93 | + with: |
| 94 | + python-version: ${{ env.python_version }} |
| 95 | + - uses: actions/cache@v3 |
| 96 | + with: |
| 97 | + path: ~/.local/share/virtualenvs |
| 98 | + key: ${{ runner.os }}-python-${{ env.python_version }}-pipenv-${{ hashFiles('Pipfile.lock') }} |
| 99 | + restore-keys: | |
| 100 | + ${{ runner.os }}-python-${{ env.python_version }}-pipenv- |
| 101 | + ${{ runner.os }}-python- |
| 102 | + - name: Install the dependencies |
| 103 | + run: python -m pip install --upgrade pipenv |
| 104 | + - name: Install Task |
| 105 | + uses: arduino/setup-task@v1 |
| 106 | + - name: Initialize the repo |
| 107 | + run: task -v init |
| 108 | + - name: Bump the version |
| 109 | + id: bump-version |
| 110 | + run: | |
| 111 | + task -v release |
| 112 | + TAG="$(git describe --tags)" |
| 113 | + BRANCH="$(git branch --show-current)" |
| 114 | + git push --atomic origin "${BRANCH}" "${TAG}" |
| 115 | + echo "tag=${TAG}" >> "${GITHUB_OUTPUT}" |
| 116 | + - name: Publish the release to GitHub |
| 117 | + uses: softprops/action-gh-release@v1 |
| 118 | + env: |
| 119 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 120 | + with: |
| 121 | + name: ${{ steps.bump-version.outputs.tag }} |
| 122 | + tag_name: ${{ steps.bump-version.outputs.tag }} |
| 123 | + draft: false |
| 124 | + prerelease: false |
0 commit comments