Merge pull request #31 from smartlabsAT/feature/issue-8-enhanced-lang… #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Required for creating releases and uploading assets | |
| packages: write # Required if publishing packages | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run quality checks | |
| run: pnpm run quality | |
| - name: Build extension | |
| run: pnpm run build | |
| - name: Create release archive | |
| run: | | |
| mkdir -p release | |
| cp index.js release/ | |
| cp package.json release/ | |
| cp README.md release/ 2>/dev/null || echo "No README.md found" | |
| cd release | |
| tar -czf ../super-layout-table-${{ github.ref_name }}.tar.gz * | |
| cd .. | |
| - name: Check if release exists | |
| id: check_release | |
| run: | | |
| if gh release view ${{ github.ref_name }} &>/dev/null; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| echo "Release already exists, will upload assets only" | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| echo "Release does not exist, will create it" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release (if not exists) | |
| if: steps.check_release.outputs.exists == 'false' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: super-layout-table-${{ github.ref_name }}.tar.gz | |
| generate_release_notes: true | |
| body: | | |
| ## Super Layout Table Extension for Directus | |
| ### Installation | |
| 1. Download the release archive | |
| 2. Extract to your Directus extensions folder | |
| 3. Restart Directus | |
| ### Quality Checks | |
| - ✅ TypeScript: No errors | |
| - ✅ ESLint: No errors or warnings | |
| - ✅ Prettier: Properly formatted | |
| - ✅ Build: Successful | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload assets to existing release | |
| if: steps.check_release.outputs.exists == 'true' | |
| run: | | |
| echo "Uploading assets to existing release ${{ github.ref_name }}" | |
| gh release upload ${{ github.ref_name }} \ | |
| super-layout-table-${{ github.ref_name }}.tar.gz \ | |
| --clobber | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |