Skip to content

Bump APP_VERSION to 1.0.4 in bin/desniff #21

Bump APP_VERSION to 1.0.4 in bin/desniff

Bump APP_VERSION to 1.0.4 in bin/desniff #21

Workflow file for this run

name: Release
on:
push:
tags:
- '*.*.*'
permissions:
contents: write
env:
PHAR_NAME: desniff.phar
REGISTRY: docker.io
IMAGE_NAME: backdevs/desniff
jobs:
test:
uses: ./.github/workflows/test.yml
phar-build-and-upload:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-dev
- name: Cache PHAR
uses: actions/cache@v3
with:
path: dist/${{ env.PHAR_NAME }}
key: ${{ runner.os }}-phar-${{ hashFiles('src/*.php') }}
- name: Build PHAR
uses: addnab/docker-run-action@v3
with:
image: backdevs/box:latest
options: -v ${{ github.workspace }}:/app
run: box compile
- name: Upload PHAR to release
uses: svenstaro/upload-release-action@v2
with:
file: dist/${{ env.PHAR_NAME }}
asset_name: ${{ env.PHAR_NAME }}
tag: ${{ github.ref }}
overwrite: true
docker-build-and-push:
needs: phar-build-and-upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache PHAR
uses: actions/cache@v3
with:
path: dist/${{ env.PHAR_NAME }}
key: ${{ runner.os }}-phar-${{ hashFiles('src/*.php') }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BOX_VERSION=${{ steps.meta.outputs.version }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha,mode=max
cache-from: type=gha