Bump version to 2.9.1 #93
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: Create and publish a Docker image | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| tags: | |
| - 'v*.*.*' | |
| env: | |
| IMAGE_NAME: rossigee/backups | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install test dependencies | |
| run: pip install -r requirements-dev.txt | |
| - name: Run tests | |
| run: pytest tests/ -v | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Docker meta | |
| uses: docker/metadata-action@v6 | |
| id: meta | |
| with: | |
| images: | | |
| ${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64,linux/arm64 | |
| build-and-publish-pip: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Build distribution | |
| run: | | |
| pip install build | |
| python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| build-and-publish-deb: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y dh-python python3-all debhelper build-essential fakeroot python3-setuptools | |
| - name: Build deb | |
| run: dpkg-buildpackage -us -uc -b | |
| - name: Extract release notes from CHANGELOG | |
| id: release-notes | |
| run: | | |
| VERSION="${{ github.ref_name }}" | |
| # Remove 'v' prefix if present | |
| VERSION="${VERSION#v}" | |
| # Extract release notes for this version from CHANGELOG.md | |
| # Matches from "## vX.Y.Z" to next section or end of file | |
| awk -v version="^v$VERSION" ' | |
| BEGIN { RS = "\n## "; found = 0 } | |
| $0 ~ version { found = 1 } | |
| found && /^[a-z]/ { if (found_before) exit; found_before=1 } | |
| found { print } | |
| ' CHANGELOG.md > release-notes.txt | |
| # Check if we got content | |
| if [ -s release-notes.txt ]; then | |
| echo "body<<EOF" >> $GITHUB_OUTPUT | |
| cat release-notes.txt >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| else | |
| echo "No release notes found for $VERSION" >&2 | |
| exit 1 | |
| fi | |
| - name: Upload deb to GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: ../python3-backups_*.deb | |
| body_path: release-notes.txt |