Ubuntu 22.10 is end of life #45
This file contains 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: Build VM Disk Image | |
on: | |
push: | |
branches: '*' | |
tags: 'v*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
container: ubuntu:22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- 'r1beta4' | |
architecture: | |
- x86 | |
- x86-64 | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install Dependencies | |
run: apt update && apt install curl unzip "qemu-system-$QEMU_ARCHITECTURE" -y | |
env: | |
QEMU_ARCHITECTURE: ${{ | |
matrix.architecture == 'x86-64' && 'x86' || | |
matrix.architecture | |
}} | |
- uses: hashicorp/setup-packer@main | |
with: | |
version: "1.7.1" | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
- name: Build Image | |
run: PACKER_LOG=1 bash ./build.sh '${{ matrix.version }}' '${{ matrix.architecture }}' -var 'headless=true' | |
- name: Extract Version | |
id: version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v} | |
- name: Create Release | |
id: create_release_try1 | |
continue-on-error: true | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Haiku ${{ steps.version.outputs.VERSION }} | |
draft: true | |
files: output/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release (retry) | |
id: create_release_try2 | |
if: startsWith(github.ref, 'refs/tags/v') && steps.create_release_try1.outcome == 'failure' | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Haiku ${{ steps.version.outputs.VERSION }} | |
draft: true | |
files: output/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |