v1.2.2 #125
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check and Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| release: | |
| types: [released] | |
| permissions: read-all | |
| jobs: | |
| lint: | |
| name: Lint code | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| cache: "pip" | |
| - name: Lint code | |
| shell: bash | |
| run: make lint format | |
| test-image: | |
| name: Generate test ext4 image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| set -e | |
| sudo apt-get install -y attr | |
| - name: Generate test.ext4 | |
| shell: bash | |
| run: | | |
| set -e | |
| ./_test_image.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: test.ext4 | |
| path: | | |
| test32.ext4 | |
| test32.ext4.tmp | |
| test64.ext4 | |
| test64.ext4.tmp | |
| if-no-files-found: error | |
| test: | |
| name: Test on ${{ matrix.os }} python ${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| needs: [test-image] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-latest | |
| python: | |
| - "3.9" | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| steps: | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v4 | |
| - name: Download test.ext4 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: test.ext4 | |
| path: . | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: "pip" | |
| - name: Run test | |
| shell: bash | |
| run: make test | |
| build: | |
| name: Build pip package | |
| runs-on: ubuntu-latest | |
| needs: [test, lint] | |
| steps: | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install build tool | |
| run: pip install build | |
| - name: Building package | |
| run: make release | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: pip | |
| path: dist/* | |
| if-no-files-found: error | |
| publish: | |
| name: Publish to PyPi | |
| if: github.repository == 'Eeems/python-ext4' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/ext4 | |
| steps: | |
| - name: Download pip packages | |
| id: download | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pip | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: ${{ steps.download.outputs.download-path }} | |
| skip-existing: true | |
| release: | |
| name: Add pip to release | |
| if: github.repository == 'Eeems/python-ext4' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout the Git repository | |
| uses: actions/checkout@v4 | |
| - name: Download executable | |
| id: download | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pip | |
| path: dist | |
| - name: Upload to release | |
| run: find . -type f | xargs -rI {} gh release upload "$TAG" {} --clobber | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.event.release.tag_name }} | |
| working-directory: ${{ steps.download.outputs.download-path }} |