|
| 1 | +# ---------------------------------------------------------------------- |
| 2 | +# | |
| 3 | +# | Copyright (c) 2024 David Brownell |
| 4 | +# | Distributed under the MIT License. |
| 5 | +# | |
| 6 | +# ---------------------------------------------------------------------- |
| 7 | +name: "Standard" |
| 8 | + |
| 9 | +run-name: ${{ github.run_number }} [${{ github.actor }}] on ${{ github.ref_name }} |
| 10 | + |
| 11 | +on: |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + push: |
| 16 | + branches: |
| 17 | + - main |
| 18 | + schedule: |
| 19 | + - cron: '0 0 * * *' # Once a day at 12am UTC |
| 20 | + workflow_dispatch: |
| 21 | + |
| 22 | +permissions: {} |
| 23 | + |
| 24 | +jobs: |
| 25 | + # ---------------------------------------------------------------------- |
| 26 | + action_contexts: |
| 27 | + name: "Display GitHub Action Contexts" |
| 28 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_display_action_contexts.yaml@CI-v0.20.0 |
| 29 | + |
| 30 | + # ---------------------------------------------------------------------- |
| 31 | + validate: |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + |
| 35 | + matrix: |
| 36 | + os: |
| 37 | + - macos-latest |
| 38 | + - ubuntu-latest |
| 39 | + - windows-latest |
| 40 | + |
| 41 | + python_version: |
| 42 | + - "3.12" |
| 43 | + - "3.11" |
| 44 | + - "3.10" |
| 45 | + # - "3.9" # Not supported |
| 46 | + # - "3.8" # Not supported |
| 47 | + |
| 48 | + name: Validate |
| 49 | + |
| 50 | + permissions: |
| 51 | + contents: read |
| 52 | + |
| 53 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_validate_python.yaml@CI-v0.20.0 |
| 54 | + with: |
| 55 | + operating_system: ${{ matrix.os }} |
| 56 | + python_version: ${{ matrix.python_version }} |
| 57 | + |
| 58 | + # ---------------------------------------------------------------------- |
| 59 | + package_coverage: |
| 60 | + needs: validate |
| 61 | + |
| 62 | + name: Postprocess Coverage Info |
| 63 | + |
| 64 | + permissions: |
| 65 | + contents: read |
| 66 | + |
| 67 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_package_python_coverage.yaml@CI-v0.20.0 |
| 68 | + with: |
| 69 | + gist_id: f15146b1b8fdc0a5d45ac0eb786a84f7 |
| 70 | + gist_filename: FileBackup_coverage.json |
| 71 | + secrets: |
| 72 | + GIST_TOKEN: ${{ secrets.GIST_TOKEN }} |
| 73 | + |
| 74 | + # ---------------------------------------------------------------------- |
| 75 | + create_package: |
| 76 | + needs: validate |
| 77 | + |
| 78 | + strategy: |
| 79 | + fail-fast: false |
| 80 | + |
| 81 | + matrix: |
| 82 | + os: |
| 83 | + - macos-latest |
| 84 | + - ubuntu-latest |
| 85 | + - windows-latest |
| 86 | + |
| 87 | + python_version: |
| 88 | + - "3.12" |
| 89 | + - "3.11" |
| 90 | + - "3.10" |
| 91 | + # - "3.9" # Not supported |
| 92 | + # - "3.8" # Not supported |
| 93 | + |
| 94 | + name: Create Package |
| 95 | + |
| 96 | + permissions: |
| 97 | + contents: read |
| 98 | + |
| 99 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_create_python_package.yaml@CI-v0.20.0 |
| 100 | + with: |
| 101 | + operating_system: ${{ matrix.os }} |
| 102 | + python_version: ${{ matrix.python_version }} |
| 103 | + |
| 104 | + # ---------------------------------------------------------------------- |
| 105 | + validate_package: |
| 106 | + needs: create_package |
| 107 | + |
| 108 | + strategy: |
| 109 | + fail-fast: false |
| 110 | + |
| 111 | + matrix: |
| 112 | + os: |
| 113 | + - macos-latest |
| 114 | + - ubuntu-latest |
| 115 | + - windows-latest |
| 116 | + |
| 117 | + python_version: |
| 118 | + - "3.12" |
| 119 | + - "3.11" |
| 120 | + - "3.10" |
| 121 | + # - "3.9" # Not supported |
| 122 | + # - "3.8" # Not supported |
| 123 | + |
| 124 | + name: Validate Package |
| 125 | + |
| 126 | + permissions: |
| 127 | + contents: read |
| 128 | + |
| 129 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_validate_python_package.yaml@CI-v0.20.0 |
| 130 | + with: |
| 131 | + operating_system: ${{ matrix.os }} |
| 132 | + python_version: ${{ matrix.python_version }} |
| 133 | + validation_command: python -c "from FileBackup import __version__; print(__version__)" |
| 134 | + |
| 135 | + # ---------------------------------------------------------------------- |
| 136 | + create_binary: |
| 137 | + needs: validate |
| 138 | + |
| 139 | + strategy: |
| 140 | + fail-fast: false |
| 141 | + |
| 142 | + matrix: |
| 143 | + os: |
| 144 | + - macos-latest |
| 145 | + - ubuntu-latest |
| 146 | + - windows-latest |
| 147 | + |
| 148 | + python_version: |
| 149 | + - "3.11" |
| 150 | + |
| 151 | + name: Create Binary |
| 152 | + |
| 153 | + permissions: |
| 154 | + contents: read |
| 155 | + |
| 156 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_create_python_binary.yaml@CI-v0.20.0 |
| 157 | + with: |
| 158 | + operating_system: ${{ matrix.os }} |
| 159 | + python_version: ${{ matrix.python_version }} |
| 160 | + |
| 161 | + # ---------------------------------------------------------------------- |
| 162 | + validate_binary: |
| 163 | + needs: create_binary |
| 164 | + |
| 165 | + strategy: |
| 166 | + fail-fast: false |
| 167 | + |
| 168 | + matrix: |
| 169 | + os: |
| 170 | + - macos-latest |
| 171 | + - ubuntu-latest |
| 172 | + - windows-latest |
| 173 | + |
| 174 | + python_version: |
| 175 | + - "3.11" |
| 176 | + |
| 177 | + name: Validate Binary |
| 178 | + |
| 179 | + permissions: |
| 180 | + contents: read |
| 181 | + |
| 182 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_validate_python_binary.yaml@CI-v0.20.0 |
| 183 | + with: |
| 184 | + operating_system: ${{ matrix.os }} |
| 185 | + python_version: ${{ matrix.python_version }} |
| 186 | + validation_command: FileBackup Version |
| 187 | + |
| 188 | + |
| 189 | +# ---------------------------------------------------------------------- |
| 190 | + create_docker_image: |
| 191 | + needs: validate |
| 192 | + |
| 193 | + strategy: |
| 194 | + fail-fast: false |
| 195 | + |
| 196 | + matrix: |
| 197 | + python_version: |
| 198 | + - "3.12" |
| 199 | + - "3.11" |
| 200 | + - "3.10" |
| 201 | + # - "3.9" # Not supported |
| 202 | + # - "3.8" # Not supported |
| 203 | + |
| 204 | + name: Create Docker Image |
| 205 | + |
| 206 | + permissions: |
| 207 | + contents: read |
| 208 | + packages: write |
| 209 | + |
| 210 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_create_docker_image.yaml@CI-v0.20.0 |
| 211 | + with: |
| 212 | + operating_system: ubuntu-latest |
| 213 | + python_version: ${{ matrix.python_version }} |
| 214 | + name_suffix: -${{ matrix.python_version }} |
| 215 | + bootstrap_args: "" |
| 216 | + docker_description: "FileBackup - ${{ matrix.python_version }}" |
| 217 | + push_image_as_package: true |
| 218 | + container_registry_username: davidbrownell |
| 219 | + |
| 220 | + |
| 221 | + # ---------------------------------------------------------------------- |
| 222 | + publish: |
| 223 | + needs: |
| 224 | + - validate_package |
| 225 | + - validate_binary |
| 226 | + |
| 227 | + - create_docker_image |
| 228 | + |
| 229 | + |
| 230 | + name: Publish |
| 231 | + |
| 232 | + permissions: |
| 233 | + contents: write |
| 234 | + |
| 235 | + uses: davidbrownell/dbrownell_DevTools/.github/workflows/callable_publish_python.yaml@CI-v0.20.0 |
| 236 | + with: |
| 237 | + release_sources_configuration_filename: .github/release_sources.yaml |
| 238 | + secrets: |
| 239 | + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
| 240 | + |
| 241 | + MINISIGN_PRIVATE_KEY: ${{ secrets.MINISIGN_PRIVATE_KEY }} |
| 242 | + |
0 commit comments