-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (36 loc) · 1.19 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
on:
push:
tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Upload Release Asset
jobs:
build:
name: Upload Release Asset OC 4.0 # Name of the job
runs-on: ubuntu-latest # or windows-latest, macOS-latest
steps:
- name: Install Hub
run: |
sudo apt-get update
sudo apt-get install -y hub
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: '8.1' # PHP version to use
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV # Extract the version number from the tag
- name: Checkout code
uses: actions/checkout@v2 # Checkout the code
- name: Build project
run: ./bin/release.sh ${{ env.VERSION }} # Build the project
- name: Upload Release Asset
run: |
set -x
assets=()
for asset in ./.dist/*.ocmod.zip; do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "Release $tag_name" "$tag_name" -d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}