|
| 1 | +name: Build AlmaLinux OS 9 WSL images |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + minor_version: |
| 6 | + description: 'Minor version of AlmaLinux OS 9' |
| 7 | + default: 6 |
| 8 | + type: number |
| 9 | + build_number: |
| 10 | + description: 'Build number of image version' |
| 11 | + default: 0 |
| 12 | + type: number |
| 13 | + release: |
| 14 | + description: 'Release on GitHub' |
| 15 | + default: false |
| 16 | + type: boolean |
| 17 | + almalinux_chat_notiy: |
| 18 | + description: 'Notify AlmaLinux Chat' |
| 19 | + default: true |
| 20 | + type: boolean |
| 21 | + almalinux_chat_channel: |
| 22 | + description: 'Channel name on AlmaLinux Chat' |
| 23 | + default: sigcloud |
| 24 | + type: string |
| 25 | +jobs: |
| 26 | + prepare: |
| 27 | + name: Build timestamp and version |
| 28 | + runs-on: ubuntu-24.04 |
| 29 | + outputs: |
| 30 | + timestamp: ${{ steps.timestamp_and_version.outputs.timestamp }} |
| 31 | + version: ${{ steps.timestamp_and_version.outputs.version }} |
| 32 | + steps: |
| 33 | + - name: Generate timestamp and version |
| 34 | + id: timestamp_and_version |
| 35 | + run: |- |
| 36 | + timestamp=$(date -u '+%Y%m%d%H%M%S') |
| 37 | + version=${timestamp:0:8} |
| 38 | + echo "timestamp=$timestamp" >> "$GITHUB_OUTPUT" |
| 39 | + echo "version=$version" >> "$GITHUB_OUTPUT" |
| 40 | + build: |
| 41 | + name: Build images |
| 42 | + needs: prepare |
| 43 | + strategy: |
| 44 | + matrix: |
| 45 | + architecture: |
| 46 | + - x64 |
| 47 | + - ARM64 |
| 48 | + runner: |
| 49 | + - ubuntu-24.04 |
| 50 | + - ubuntu-24.04-arm |
| 51 | + exclude: |
| 52 | + - architecture: x64 |
| 53 | + runner: ubuntu-24.04-arm |
| 54 | + - architecture: ARM64 |
| 55 | + runner: ubuntu-24.04 |
| 56 | + runs-on: ${{ matrix.runner }} |
| 57 | + steps: |
| 58 | + - name: Checkout |
| 59 | + uses: actions/checkout@v4 |
| 60 | + - name: Build a WSL image |
| 61 | + run: bash -x rootfs/almalinux_9_${{ matrix.architecture }}.sh ${{ inputs.minor_version}} ${{ inputs.build_number }} |
| 62 | + - name: Upload artifacts to GitHub |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + with: |
| 65 | + name: AlmaLinux_9_${{ matrix.architecture }} |
| 66 | + path: AlmaLinux-9.*_*.wsl* |
| 67 | + - name: Upload artifact to AlmaLinux Cloud object storage |
| 68 | + if: ${{ ! inputs.release }} |
| 69 | + env: |
| 70 | + AWS_ACCESS_KEY_ID: ${{ secrets.ALMALINUX_CLOUD_BOT_AWS_ACCESS_KEY_ID }} |
| 71 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.ALMALINUX_CLOUD_BOT_AWS_SECRET_ACCESS_KEY }} |
| 72 | + AWS_DEFAULT_REGION: 'us-east-1' |
| 73 | + run: |- |
| 74 | + aws s3 cp . \ |
| 75 | + s3://almalinux-cloud/images/9/9.${{ inputs.minor_version }}/wsl/${{ needs.prepare.outputs.timestamp }}/ \ |
| 76 | + --recursive \ |
| 77 | + --exclude '*' --include '*.wsl*' |
| 78 | + aws s3api put-object-tagging \ |
| 79 | + --bucket almalinux-cloud \ |
| 80 | + --key images/9/9.${{ inputs.minor_version }}/wsl/${{ needs.prepare.outputs.timestamp }}/AlmaLinux-9.${{ inputs.minor_version }}_${{ matrix.architecture }}_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl \ |
| 81 | + --tagging 'TagSet={Key=public,Value=yes}' |
| 82 | + aws s3api put-object-tagging \ |
| 83 | + --bucket almalinux-cloud \ |
| 84 | + --key images/9/9.${{ inputs.minor_version }}/wsl/${{ needs.prepare.outputs.timestamp }}/AlmaLinux-9.${{ inputs.minor_version }}_${{ matrix.architecture }}_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum \ |
| 85 | + --tagging 'TagSet={Key=public,Value=yes}' |
| 86 | + release: |
| 87 | + if: ${{ inputs.release }} |
| 88 | + name: Release images on GitHub |
| 89 | + runs-on: ubuntu-24.04 |
| 90 | + needs: |
| 91 | + - prepare |
| 92 | + - build |
| 93 | + steps: |
| 94 | + - name: Checkout |
| 95 | + uses: actions/checkout@v4 |
| 96 | + - name: Download artifacts for release |
| 97 | + uses: actions/download-artifact@v4 |
| 98 | + with: |
| 99 | + merge-multiple: true |
| 100 | + - name: Release |
| 101 | + env: |
| 102 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 103 | + run: |- |
| 104 | + gh release \ |
| 105 | + create "v9.${{ inputs.minor_version }}.${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}" \ |
| 106 | + --title "AlmaLinux OS 9.${{ inputs.minor_version }}.${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}" \ |
| 107 | + --generate-notes \ |
| 108 | + --latest \ |
| 109 | + ./*.wsl ./*.sha256sum |
| 110 | + notify_build: |
| 111 | + if: ${{ ! inputs.release && inputs.almalinux_chat_notiy }} |
| 112 | + name: Notify AlmaLinux Chat about test builds |
| 113 | + needs: |
| 114 | + - prepare |
| 115 | + - build |
| 116 | + runs-on: ubuntu-24.04 |
| 117 | + steps: |
| 118 | + - name: Notify AlmaLinux Chat |
| 119 | + env: |
| 120 | + image_url_x64: https://almalinux-cloud.s3-accelerate.dualstack.amazonaws.com/images/9/9.${{ inputs.minor_version }}/wsl/${{ needs.prepare.outputs.timestamp }}/AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl |
| 121 | + image_url_ARM64: https://almalinux-cloud.s3-accelerate.dualstack.amazonaws.com/images/9/9.${{ inputs.minor_version }}/wsl/${{ needs.prepare.outputs.timestamp }}/AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl |
| 122 | + checksum_url_x64: https://almalinux-cloud.s3-accelerate.dualstack.amazonaws.com/images/9/9.${{ inputs.minor_version }}/wsl/${{ needs.prepare.outputs.timestamp }}/AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum |
| 123 | + checksum_url_ARM64: https://almalinux-cloud.s3-accelerate.dualstack.amazonaws.com/images/9/9.${{ inputs.minor_version }}/wsl/${{ needs.prepare.outputs.timestamp }}/AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum |
| 124 | + uses: mattermost/action-mattermost-notify@master |
| 125 | + with: |
| 126 | + MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }} |
| 127 | + MATTERMOST_CHANNEL: ${{ inputs.almalinux_chat_channel }} |
| 128 | + MATTERMOST_USERNAME: 'github' |
| 129 | + TEXT: |- |
| 130 | + ##### [TEST]: AlmaLinux OS 9.${{ inputs.minor_version }} WSL Images [Build](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}): `${{ needs.prepare.outputs.timestamp }}` |
| 131 | + ###### Images |
| 132 | + :almalinux: **x64:** [AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl](${{ env.image_url_x64 }}) |
| 133 | + :almalinux: **ARM64:** [AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl](${{ env.image_url_ARM64 }}) |
| 134 | + ###### Checksums |
| 135 | + :lock_with_ink_pen: **x64:** [AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum](${{ env.checksum_url_x64 }}) |
| 136 | + :lock_with_ink_pen: **ARM64:** [AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum](${{ env.checksum_url_ARM64 }}) |
| 137 | + notify_release: |
| 138 | + name: Notify AlmaLinux Chat about release builds |
| 139 | + needs: |
| 140 | + - prepare |
| 141 | + - release |
| 142 | + runs-on: ubuntu-24.04 |
| 143 | + steps: |
| 144 | + - name: Notify AlmaLinux Chat |
| 145 | + env: |
| 146 | + image_url_x64: ${{ github.server_url }}/${{ github.repository }}/releases/download/v9.${{ inputs.minor_version }}.${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}/AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl |
| 147 | + image_url_ARM64: ${{ github.server_url }}/${{ github.repository }}/releases/download/v9.${{ inputs.minor_version }}.${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}/AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl |
| 148 | + checksum_url_x64: ${{ github.server_url }}/${{ github.repository }}/releases/download/v9.${{ inputs.minor_version }}.${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}/AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum |
| 149 | + checksum_url_ARM64: ${{ github.server_url }}/${{ github.repository }}/releases/download/v9.${{ inputs.minor_version }}.${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}/AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum |
| 150 | + uses: mattermost/action-mattermost-notify@master |
| 151 | + with: |
| 152 | + MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }} |
| 153 | + MATTERMOST_CHANNEL: ${{ inputs.almalinux_chat_channel }} |
| 154 | + MATTERMOST_USERNAME: 'github' |
| 155 | + TEXT: |- |
| 156 | + ##### [RELEASE]: AlmaLinux OS 9.${{ inputs.minor_version }} WSL Images [Build](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}): `${{ needs.prepare.outputs.timestamp }}` |
| 157 | + ###### Images |
| 158 | + :almalinux: **x64:** [AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl](${{ env.image_url_x64 }}) |
| 159 | + :almalinux: **ARM64:** [AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl](${{ env.image_url_ARM64 }}) |
| 160 | + ###### Checksums |
| 161 | + :lock_with_ink_pen: **x64:** [AlmaLinux-9.${{ inputs.minor_version }}_x64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum](${{ env.checksum_url_x64 }}) |
| 162 | + :lock_with_ink_pen: **ARM64:** [AlmaLinux-9.${{ inputs.minor_version }}_ARM64_${{ needs.prepare.outputs.version }}.${{ inputs.build_number }}.wsl.sha256sum](${{ env.checksum_url_ARM64 }}) |
0 commit comments