Skip to content

Commit 6eb36eb

Browse files
committed
script for automatically uploading assert
1 parent 7373b4f commit 6eb36eb

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: release php package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Package pinpoint_php
16+
id: pack
17+
run: |
18+
tar -czf ${{ env.MODULE_PAK }} common/ src/PHP config.m4 tests LICENSE
19+
md5=($(md5sum ${{ env.MODULE_PAK }} ))
20+
PACK_NAME=${{ env.MODULE_PAK }}-${md5}-$(date '+%Y-%m-%d').tar.gz
21+
mv ${{ env.MODULE_PAK }} $PACK_NAME
22+
echo "PACK=$PACK_NAME" >> $GITHUB_OUTPUT
23+
- name: Release php_package
24+
id: rel_php_pak
25+
uses: softprops/action-gh-release@v2
26+
if: startsWith(github.ref, 'refs/tags/')
27+
with:
28+
files: ${{ steps.pack.outputs.PACK }}
29+
30+
- name: generate install_pinpoint_php.sh
31+
run: |
32+
PACK_URL=${{ fromJSON(steps.rel_php_pak.outputs.assets)[0].browser_download_url }}
33+
## replace __PACK_URL__
34+
cat install_pinpoint_php.sh | sed -e "s|__PACK_URL__|${PACK_URL}|g" > install_pinpoint_php.sh
35+
36+
- name: Release install_pinpoint_php
37+
uses: softprops/action-gh-release@v2
38+
if: startsWith(github.ref, 'refs/tags/')
39+
with:
40+
files: install_pinpoint_php.sh

install_pinpoint_php.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func_output_n(){
2020
}
2121

2222
func_download_extension(){
23-
mkdir -p /tmp/pinpoint_php && cd /tmp/pinpoint_php && curl -L -o pinpoint_php.tar.gz https://github.com/pinpoint-apm/pinpoint-c-agent/releases/download/v0.6.0/pinpoint_php@v0.6.0-418bec8f2f0ff1d9213f683214f1b835-2024-07-08.tar.gz && tar xvf pinpoint_php.tar.gz && phpize && ./configure && make install
23+
mkdir -p /tmp/pinpoint_php && cd /tmp/pinpoint_php && curl -L -o pinpoint_php.tar.gz __PACK_URL__ && tar xvf pinpoint_php.tar.gz && phpize && ./configure && make install
2424

2525
# mkdir -p /tmp/pinpoint_php && cd /tmp/pinpoint_php && curl -L -o pinpoint_php.tar.gz https://github.com/eeliu/pinpoint-c-agent/releases/download/$PINPOINT_PHP_VERSION/pinpoint_php@$PINPOINT_PHP_VERSION.tar.gz && tar xvf pinpoint_php.tar.gz && phpize && ./configure && make install
2626
# && rm /tmp/pinpoint_php* -rf

0 commit comments

Comments
 (0)