-
-
Notifications
You must be signed in to change notification settings - Fork 734
80 lines (69 loc) · 2.64 KB
/
Copy pathbuild-release-packages.yml
File metadata and controls
80 lines (69 loc) · 2.64 KB
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
name: Build Release Packages
on:
workflow_dispatch:
inputs:
tag:
description: Tag to use in archive names, for example v1.0.0
required: true
type: string
release_name:
description: Release title shown in the GitHub Releases page
required: true
type: string
jobs:
build-release-packages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository into livehelperchat-master
uses: actions/checkout@v4
with:
path: livehelperchat-master
- name: Create and push release tag
working-directory: livehelperchat-master
run: |
TAG="${{ inputs.tag }}"
if git ls-remote --tags origin "refs/tags/${TAG}" | grep -q "refs/tags/${TAG}$"; then
echo "Tag ${TAG} already exists on origin"
exit 1
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag "${TAG}"
git push origin "refs/tags/${TAG}"
- name: Setup PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
tools: composer
coverage: none
- name: Install Composer dependencies in lhc_web
working-directory: livehelperchat-master/lhc_web
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Build release archives
run: |
tar czfv "${{ inputs.tag }}-with-dependencies.tgz" \
--exclude='livehelperchat-master/.git' \
--exclude='livehelperchat-master/.github' \
livehelperchat-master/
zip -r "${{ inputs.tag }}-with-dependencies.zip" livehelperchat-master/ \
-x 'livehelperchat-master/.git/*' 'livehelperchat-master/.github/*'
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: "${{ inputs.tag }}"
name: "${{ inputs.release_name }}"
files: |
${{ inputs.tag }}-with-dependencies.tgz
${{ inputs.tag }}-with-dependencies.zip
- name: Upload tgz artifact
uses: actions/upload-artifact@v4
with:
name: "${{ inputs.tag }}-with-dependencies-tgz"
path: "${{ inputs.tag }}-with-dependencies.tgz"
- name: Upload zip artifact
uses: actions/upload-artifact@v4
with:
name: "${{ inputs.tag }}-with-dependencies-zip"
path: "${{ inputs.tag }}-with-dependencies.zip"