Skip to content

Remove pre-release flag #12

Remove pre-release flag

Remove pre-release flag #12

Workflow file for this run

name: Build Piaros
on:
workflow_dispatch:
pull_request:
push:
tags:
- 'v*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
builder: x86_64-musl
platform: linux/amd64
- arch: arm64
builder: aarch64-musl
platform: linux/arm64
- arch: arm
builder: armv7-musleabihf
platform: linux/arm/v7
runs-on: ubuntu-latest
name: build-${{ matrix.arch }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
suffix=-${{ matrix.arch }},onlatest=true
latest=${{ github.event_name == 'push' && github.ref_type == 'tag' }}
- id: build
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BUILDER_TAG=${{ matrix.builder }}
platforms: ${{ matrix.platform }}
- run: docker image save ${{ steps.build.outputs.imageid }} -o piaros-${{ matrix.arch }}.tar
- uses: actions/upload-artifact@v4
with:
name: piaros-${{ matrix.arch }}.tar
path: piaros-*.tar
release:
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Release Docker iamge
run: |
docker image load < piaros-amd64.tar
docker image load < piaros-arm64.tar
docker image load < piaros-arm.tar
docker manifest create ghcr.io/fruel/piaros:latest \
--amend ghcr.io/fruel/piaros:latest-amd64 \
--amend ghcr.io/fruel/piaros:latest-arm64 \
--amend ghcr.io/fruel/piaros:latest-arm
docker manifest push ghcr.io/fruel/piaros:latest
- name: Create GitHub Release
env:
VERSION: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create '${{ env.VERSION }}' \
-R ${{ github.repository }} \
-t 'Piaros ${{ env.VERSION }}' \
--generate-notes \
piaros-*.tar