Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Feb 4, 2025
1 parent 082b766 commit 3b629d7
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release ZIP Build

on:
release:
types: [created]

jobs:
build-and-upload:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Install Node.js dependencies
run: npm install --production

- name: Install Composer dependencies
run: composer install --no-dev --optimize-autoloader

- name: Create versioned ZIP file
run: |
ZIP_NAME="moodle-local_h5pcarateker-${{ env.RELEASE_VERSION }}.zip"
echo "ZIP_NAME=${ZIP_NAME}" >> $GITHUB_ENV
zip -r "$ZIP_NAME" . \
-x ".github/*" ".gitignore" \
"composer.json" "composer.lock" \
"package.json" "package-lock.json"
- name: Upload ZIP to Release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ZIP_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3b629d7

Please sign in to comment.