xref: /plugin/skillforge/.github/workflows/release.yml (revision 12fa7ce06de4829ce464095e917e18197b9d4bba)
1name: Build and Release Plugin
2
3on:
4  push:
5    branches:
6      - main
7
8jobs:
9  build-release:
10    runs-on: ubuntu-latest
11
12    steps:
13      - uses: actions/checkout@v4
14
15      - name: Extract plugin name and version
16        id: plugin-info
17        run: |
18          BASE=$(grep "^base" plugin.info.txt | cut -d' ' -f2)
19          DATE=$(date +%Y%m%d_%H%M%S)
20          VERSION=$(grep "^date" plugin.info.txt | cut -d' ' -f2)
21          TAG="${BASE}_${VERSION}_${DATE}"
22          echo "base=${BASE}" >> $GITHUB_OUTPUT
23          echo "version=${VERSION}" >> $GITHUB_OUTPUT
24          echo "tag=${TAG}" >> $GITHUB_OUTPUT
25          echo "Plugin: ${BASE}, Version: ${VERSION}, Tag: ${TAG}"
26
27      - name: Create plugin package
28        run: |
29          mkdir -p skillforge-package
30          # Copy all plugin files except git-related and excluded files
31          cp -r action.php admin.php helper.php syntax.php plugin.info.txt README.md LICENSE CHANGELOG.md style.css skillforge-package/
32          cp -r classes/ conf/ lang/ skillforge-package/
33
34          # Create ZIP archive
35          zip -r skillforge-${{ steps.plugin-info.outputs.version }}.zip skillforge-package/
36          ls -lh skillforge-*.zip
37
38      - name: Create Release
39        uses: softprops/action-gh-release@v1
40        with:
41          tag_name: ${{ steps.plugin-info.outputs.tag }}
42          name: SkillForge Release ${{ steps.plugin-info.outputs.version }}
43          body: |
44            ## SkillForge DokuWiki Plugin
45
46            **Version:** ${{ steps.plugin-info.outputs.version }}
47            **Base:** ${{ steps.plugin-info.outputs.base }}
48
49            ### Installation
50
51            1. Download the `skillforge-${{ steps.plugin-info.outputs.version }}.zip` file below
52            2. Extract it in your DokuWiki plugins directory: `lib/plugins/`
53            3. Go to Admin → SkillForge to configure
54
55            ### What's included
56            - Plugin core files (action.php, admin.php, helper.php, syntax.php)
57            - Configuration templates (conf/)
58            - Language files (lang/)
59            - Documentation (README.md, CHANGELOG.md)
60          files: |
61            skillforge-${{ steps.plugin-info.outputs.version }}.zip
62          draft: false
63          prerelease: false
64        env:
65          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66