-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (62 loc) · 2 KB
/
release-tag.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
name: Build & Draft Release
on:
push:
tags:
- '*.*.*'
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo
- name: Install PHP dependencies
run: composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --optimize-autoloader
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install JS dependencies
run: bun install
- name: Build JS assets
run: bun run build
- name: Create tar.gz archive
run: |
mkdir -p ./release
tar -czf ./release/leconfe.tar.gz \
--exclude='./.dockerdata' \
--exclude='./release' \
--exclude='./.git' \
--exclude='./node_modules' \
--exclude='./tests' \
--exclude='./.github' \
-C . .
ls -l ./release/leconfe.tar.gz
if [ ! -f ./release/leconfe.tar.gz ]; then
echo "Error: leconfe.tar.gz was not created"
exit 1
fi
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Leconfe Release ${{ github.ref_name }}
draft: true
prerelease: false
generate_release_notes: true
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/leconfe.tar.gz
asset_name: leconfe-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip