Skip to content

Commit d818caa

Browse files
committed
Add .github/workflows/build.yml
1 parent 0c21083 commit d818caa

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build PerformanceProfiler Plugin
2+
on:
3+
push:
4+
branches:
5+
- "**/*"
6+
tags:
7+
- "v*"
8+
- "*@v*"
9+
# pull_request:
10+
# types: [opened, synchronize]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
env:
16+
NODE_ENV: production
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
persist-credentials: false
23+
24+
- name: Install libs
25+
run: sudo apt-get install --no-install-recommends -y libjson-perl libyaml-perl zip
26+
27+
- name: Build plugin
28+
run: |
29+
perl Makefile.PL
30+
make manifest
31+
make zipdist
32+
make dist
33+
34+
- name: Upload all plugins
35+
id: upload-all-plugins
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: plugin
39+
path: |
40+
PerformanceProfiler-*
41+
42+
- name: Upload tarball
43+
id: upload-tarball
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: tarball
47+
path: |
48+
PerformanceProfiler-*.tar.gz
49+
50+
- name: Add comment to PR
51+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
52+
if: ${{ github.event_name == 'pull_request' }}
53+
with:
54+
issue-number: ${{ github.event.pull_request.number }}
55+
body: |
56+
### Download Links
57+
58+
You can download the build artifacts from the following links:
59+
60+
- **All Plugins**: [Download from Actions Artifacts](${{ steps.upload-all-plugins.outputs.artifact-url }})
61+
- **Tarball**: [Download from Actions Artifacts](${{ steps.upload-tarball.outputs.artifact-url }})
62+
63+
- name: Upload package to GitHub Releases
64+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
65+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8
66+
with:
67+
draft: true
68+
files: |
69+
PerformanceProfiler-*.zip
70+
PerformanceProfiler-*.tar.gz

0 commit comments

Comments
 (0)