Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 1 | # Copyright (c) 2023 VEXXHOST, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | name: manila |
| 16 | |
| 17 | on: |
| 18 | pull_request: |
| 19 | paths: |
| 20 | - .github/workflows/manila.yml |
| 21 | push: |
| 22 | branches: |
| 23 | - main |
| 24 | paths: |
| 25 | - .github/workflows/manila.yml |
Mohammed Naser | 1ec06f7 | 2023-03-28 02:56:40 +0000 | [diff] [blame] | 26 | release: |
| 27 | types: |
| 28 | - published |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 29 | workflow_dispatch: |
| 30 | |
| 31 | jobs: |
| 32 | build-image: |
| 33 | runs-on: ubuntu-latest |
| 34 | steps: |
| 35 | - name: Checkout project |
renovate[bot] | 38929d4 | 2024-01-02 11:18:18 -0500 | [diff] [blame] | 36 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 37 | with: |
| 38 | fetch-depth: 0 |
| 39 | |
| 40 | - name: Install dependencies |
| 41 | run: | |
ricolin | a586ec5 | 2023-06-02 00:14:44 +0800 | [diff] [blame] | 42 | sudo apt-get update |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 43 | sudo apt-get install -y debootstrap qemu-utils |
| 44 | pipx install diskimage-builder==3.28.0 |
| 45 | pipx install python-swiftclient |
Mohammed Naser | 2607b55 | 2023-03-27 23:39:42 +0000 | [diff] [blame] | 46 | pipx inject python-swiftclient python-keystoneclient |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 47 | pipx install poetry |
| 48 | poetry self add "poetry-dynamic-versioning[plugin]" |
| 49 | |
| 50 | - name: Clone openstack/manila-image-elements |
renovate[bot] | 38929d4 | 2024-01-02 11:18:18 -0500 | [diff] [blame] | 51 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 52 | with: |
| 53 | repository: openstack/manila-image-elements |
| 54 | path: manila-image-elements |
| 55 | |
| 56 | - name: Cache DIB_IMAGE_CACHE |
renovate[bot] | 73e5ad9 | 2024-02-09 10:44:20 -0500 | [diff] [blame] | 57 | uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 58 | with: |
| 59 | path: ~/.cache/image-create |
| 60 | key: dib-image-cache |
| 61 | |
| 62 | - name: Build image |
Mohammed Naser | d88e831 | 2023-03-28 02:22:46 +0000 | [diff] [blame] | 63 | run: disk-image-create -o manila-$(poetry version --short).qcow2 vm manila-ubuntu-minimal dhcp-all-interfaces manila-ssh ubuntu-nfs ubuntu-cifs |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 64 | env: |
| 65 | ELEMENTS_PATH: manila-image-elements/elements |
| 66 | |
| 67 | - name: Publish image |
Mohammed Naser | 1ec06f7 | 2023-03-28 02:56:40 +0000 | [diff] [blame] | 68 | if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' |
Mohammed Naser | 19871ba | 2023-03-27 22:38:39 +0000 | [diff] [blame] | 69 | run: | |
| 70 | swift post -r '.r:*,.rlistings' atmosphere-images |
| 71 | swift upload atmosphere-images manila-$(poetry version --short).qcow2 |
| 72 | env: |
| 73 | OS_AUTH_URL: https://auth.vexxhost.net/v3 |
| 74 | OS_REGION_NAME: ca-ymq-1 |
| 75 | OS_USER_DOMAIN_NAME: Default |
| 76 | OS_USERNAME: ${{ secrets.OS_USERNAME }} |
| 77 | OS_PASSWORD: ${{ secrets.OS_PASSWORD }} |
| 78 | OS_PROJECT_DOMAIN_NAME: Default |
| 79 | OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }} |