Skip to content

Publish

Publish #22

Workflow file for this run

#
# JBZoo Toolbox - Csv-Blueprint.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @see https://github.com/JBZoo/Csv-Blueprint
#
name: Publish
on:
release:
types: [ published ]
jobs:
phar:
name: Publish Phar
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer
- name: Build project in production mode
run: make build-prod build-phar-file --no-print-directory
- name: 🎨 Test Phar file
run: ./build/csv-blueprint.phar --ansi -vvv
- name: Upload Phar to the release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
./build/csv-blueprint.phar
docker:
name: Publish Docker
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: .
tags: |
jbzoo/csv-blueprint:latest
jbzoo/csv-blueprint:${{ github.event.release.tag_name }}
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ github.event.release.tag_name }}
- name: Verify the Docker image by tag
run: docker run --rm jbzoo/csv-blueprint:${{ github.event.release.tag_name }} --ansi -vvv
- name: Verify the Docker image by latest
run: docker run --rm jbzoo/csv-blueprint:latest --ansi -vvv