-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (74 loc) · 2.23 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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