62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
name: Telegram Mini App Shop Builder
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
module-build:
|
|
if: github.ref == 'refs/heads/master'
|
|
name: Build module.
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- 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:
|
|
if: github.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
needs: [module-build]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # to fetch tags
|
|
|
|
- name: Extract tag and set filename
|
|
id: meta
|
|
run: |
|
|
TAG=${GITHUB_REF#refs/tags/}
|
|
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:
|
|
tag_name: ${{ steps.meta.outputs.tag }}
|
|
files: ./build/${{ steps.meta.outputs.filename }}
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|