-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (47 loc) · 1.52 KB
/
build.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
name: Build package release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install git zip unzip curl jq -y
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: imagick, swoole
- name: Set run permissions
run: sudo chmod +x ./build.sh
- name: Run build script
run: |
export TERM=xterm
./build.sh jmpdf
ls -l
- name: Get build info
id: build_info
run: |
ls -l
BUILD_VERSION=$(unzip -p ./jmpdf.zip jmpdf.xml | grep -oPm1 "(?<=<version>)[^<]+")
BUILD_TIMESTAMP=$(date +%s)
echo ::set-output name=TIMESTAMP::$BUILD_TIMESTAMP
if [[ -n $BUILD_VERSION ]]; then
echo ::set-output name=VERSION::$BUILD_VERSION
else
echo "Failed to get package version"
exit 1
fi
- name: Draft release
uses: ncipollo/release-action@v1
with:
artifacts: "jmpdf.zip"
token: ${{ secrets.REPO_TOKEN }}
allowUpdates: false
artifactErrorsFailBuild: true
tag: "build.${{ steps.build_info.outputs.TIMESTAMP }}"
name: "${{ steps.build_info.outputs.VERSION }}-build.${{ steps.build_info.outputs.TIMESTAMP }}"