-
Notifications
You must be signed in to change notification settings - Fork 11
80 lines (65 loc) · 2 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
name: create release
on:
push:
branches:
- main
tags:
- '20*'
- 'deploy-*'
workflow_dispatch:
# stop if a second commit is pushed and a new action starts
#concurrency:
# group: '${{ github.workflow }}-${{ github.ref }}'
# cancel-in-progress: true
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: check out repository
uses: actions/checkout@v4
- name: set up node v20
uses: actions/setup-node@v4
with:
node-version: "20"
- name: cache composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: "${{ runner.os }}-${{ hashFiles('**/composer.lock') }}"
- name: disable DEBUG
run: "sed -i '/define..DEBUG/s/1/0/' codepoints.net/index.php"
- name: install composer packages
uses: php-actions/composer@v6
with:
php_version: "8.1"
php_extensions: zip
command: install
args: --quiet
- name: install npm packages
run: npm ci --silent --audit false --fund false
- name: patch npm packages
run: npm run postinstall
- name: run vite
run: npm run build
env:
NODE_ENV: production
- name: run tests
run: make test-js test-php
- name: remove PHP dev packages again
uses: php-actions/composer@v6
with:
php_version: "8.1"
php_extensions: zip
command: install
args: --optimize-autoloader --quiet --no-dev
if: startsWith(github.ref, 'refs/tags/')
- name: publish current version
run: "echo '${{ github.ref_name }}' > codepoints.net/version.txt"
- name: create zip file for release
run: zip -r codepoints codepoints.net
if: startsWith(github.ref, 'refs/tags/')
- name: create release
uses: softprops/action-gh-release@v1
with:
files: codepoints.zip
if: startsWith(github.ref, 'refs/tags/')