Files
interview-demo-code/.github/workflows/main.yaml
2025-07-10 19:14:41 +03:00

70 lines
1.8 KiB
YAML

name: Telegram Mini App Shop Builder
on:
push:
branches:
- master
permissions:
contents: write
jobs:
module-build:
name: Build module.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
- name: Build module
run: |
bash scripts/ci/build.sh "${GITHUB_WORKSPACE}"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: oc_telegram_shop.ocmod.zip
path: ./build/oc_telegram_shop.ocmod.zip
retention-days: 1
release:
runs-on: ubuntu-latest
needs: [module-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to fetch tags
- name: Extract latest tag and set filename
id: meta
run: |
LAST_TAG=$(git describe --tags --abbrev=0)
SHORT_SHA=$(git rev-parse --short=7 HEAD)
TAG="${LAST_TAG}+${SHORT_SHA}"
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "filename=oc_telegram_shop_${TAG}.ocmod.zip" >> $GITHUB_OUTPUT
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: oc_telegram_shop.ocmod.zip
path: ./build
- name: Rename artifact file
run: mv ./build/oc_telegram_shop.ocmod.zip ./build/${{ steps.meta.outputs.filename }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
prerelease: true
tag_name: ${{ steps.meta.outputs.tag }}
files: ./build/${{ steps.meta.outputs.filename }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}