-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.72 KB
/
build-artifacts.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: Weekly Release
on:
schedule:
- cron: '0 17 * * 5'
workflow_dispatch:
push:
branches:
- release
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
release:
name: Create Weekly Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure full history is fetched
- name: Use desired version of NodeJS
uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Set up Git
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
- name: Extract version from PHP file
id: get_version
run: |
VERSION=$(grep -oP 'Version:\s*\K[^\s]+' {the-plugin-name}.php)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Grant execute permissions for build script
run: chmod +x ./bin/build-plugin-zip.sh
- name: Generate plugin zip file
run: ./bin/build-plugin-zip.sh -b
- name: Upload build file as artifact
uses: actions/upload-artifact@v2
with:
name: {The Plugin Name}-${{ env.VERSION }}
path: ./{the-plugin-name}.zip