Skip to content

Update release.yml (#42) #30

Update release.yml (#42)

Update release.yml (#42) #30

Workflow file for this run

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 ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} # Extract the version number from the tag
- name: Checkout code
uses: actions/checkout@v2 # Checkout the code
- name: Build project
run: ./bin/release.sh ${{ steps.get_version.outputs.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 }}