Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on pushes and PRs #131

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 33 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
on:
workflow_dispatch:
inputs:
builds:
description: 'Builds to build'
version:
description: 'Box version'
type: string
required: false
default: >-
[
"ubuntu2404",
"fedora39",
"fedora40",
"silverblue39",
"silverblue40",
"opensusetumbleweed",
"alpine319",
"alpine318",
"opensuseleap156",
"debian12"
]
default: '0.0.0'
publish:
description: 'Publish to Vagrant Cloud'
type: boolean
default: false
required: false

workflow_call:
inputs:
version:
description: 'Box version'
type: string
required: false
default: '0.0.0'
publish:
description: 'Publish to Vagrant Cloud'
type: boolean
default: false
required: false

secrets:
VAGRANT_CLOUD_TOKEN:
description: 'Vagrant Cloud token for publishing'
required: false

env:
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
PACKER_LOG: 1
Expand All @@ -33,7 +39,17 @@ jobs:
strategy:
fail-fast: false
matrix:
build: ${{ fromJSON(inputs.builds) }}
build:
- alpine318
- alpine319
- debian12
- fedora39
- fedora40
- opensuseleap156
- opensusetumbleweed
- silverblue39
- silverblue40
- ubuntu2404

runs-on: ubuntu-22.04
steps:
Expand All @@ -56,7 +72,7 @@ jobs:
- run: packer init .
- run: >-
packer build
-var version=0.${{ github.run_number }}.${{ github.run_attempt }}
-var version=${{ inputs.version }}
${{ !inputs.publish && '-except vagrant-cloud' || '' }}
-only qemu.${{ matrix.build }}
.
11 changes: 11 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
workflow_dispatch:
pull_request:

concurrency: ${{ github.workflow }}/${{ github.ref }}

jobs:
build:
uses: ./.github/workflows/build.yml
with:
publish: false
13 changes: 13 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on:
workflow_dispatch:
push:
branches:
- master

concurrency: ${{ github.workflow }}/${{ github.ref }}

jobs:
build:
uses: ./.github/workflows/build.yml
with:
publish: false
15 changes: 15 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
workflow_dispatch:
push:
tags:
- '*'

concurrency: ${{ github.workflow }}/${{ github.ref }}

jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
with:
version: ${{ github.ref_name }}
publish: true