Release #31
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version' | |
type: string | |
required: true | |
env: | |
APP_ENV: "local" | |
REGISTRY: "ghcr.io" | |
jobs: | |
phar: | |
name: Phar | |
runs-on: ubuntu-latest | |
steps: | |
- name: Validate tag | |
uses: FidelusAleksander/[email protected] | |
with: | |
regex_pattern: "^v\\d+(\\.\\d+)?(\\.\\d+)?$" | |
regex_match_type: match | |
text: ${{ github.event.inputs.version }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "8.2" | |
extensions: "bcmath" | |
coverage: "none" | |
- name: Validate dependencies | |
run: "composer validate --strict" | |
- name: Install dependencies | |
uses: ramsey/composer-install@v2 | |
- name: Build archive | |
run: "php dime app:build dime --build-version=${{ github.event.inputs.version }}" | |
- name: Update README | |
run: "php .github/release.php ${{ github.event.inputs.version }}" | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: main | |
commit_message: "Updated phar and README" | |
- name: Draft release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ github.event.inputs.version }} | |
tag_name: ${{ github.event.inputs.version }} | |
draft: true | |
files: ./builds/dime | |
generate_release_notes: true | |
docker: | |
name: Docker | |
needs: phar | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Log into registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Set up Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: .docker/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ env.REGISTRY }}/${{ github.repository }}:latest |