Added Fusion Publish Action #1
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: π§ͺ Test Actions | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test-fusion-publish: | |
| name: π§ͺ Test Fusion Publish | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: π₯ Checkout | |
| uses: actions/checkout@v4 | |
| - name: π’ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: 'fusion-publish/package.json' | |
| - name: π¦ Install dependencies | |
| working-directory: fusion-publish | |
| run: npm ci | |
| - name: π¨ Build action | |
| working-directory: fusion-publish | |
| run: npm run build | |
| - name: β Check built action | |
| working-directory: fusion-publish | |
| run: | | |
| if [ -f "dist/index.js" ] || [ -f "dist/index.js" ]; then | |
| echo "β Built action found" | |
| else | |
| echo "β Built action not found" | |
| exit 1 | |
| fi | |
| shell: bash | |
| test-action-dry-run: | |
| name: π§ͺ Test Action (Dry Run) | |
| runs-on: ubuntu-latest | |
| needs: test-fusion-publish | |
| steps: | |
| - name: π₯ Checkout | |
| uses: actions/checkout@v4 | |
| - name: π’ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: 'fusion-publish/package.json' | |
| - name: π¦ Build action | |
| working-directory: fusion-publish | |
| run: | | |
| npm ci | |
| npm run build | |
| # This tests that the action loads and validates inputs correctly | |
| # It will fail at the actual Nitro command (which is expected) | |
| - name: π― Test Action Setup | |
| uses: ./fusion-publish | |
| with: | |
| tag: 'test-v1.0.0' | |
| stage: 'testing' | |
| api-id: 'test-api' | |
| api-key: 'test-key' | |
| continue-on-error: true | |
| create-tags: | |
| name: π·οΈ Create/Update Tags | |
| runs-on: ubuntu-latest | |
| needs: [test-fusion-publish, test-action-dry-run] | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: π₯ Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: π’ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: π¨ Build all actions | |
| run: | | |
| cd fusion-publish | |
| npm ci | |
| npm run build | |
| cd .. | |
| - name: π Commit built files | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add fusion-publish/dist/ | |
| git diff --staged --quiet || git commit -m "π¨ Update built actions" | |
| - name: π·οΈ Create/update version tags | |
| run: | | |
| git tag -fa v1 -m "Update v1 tag" | |
| git push origin v1 --force | |
| # Create v1.0 tag if it doesn't exist | |
| if ! git rev-parse v1.0 >/dev/null 2>&1; then | |
| git tag v1.0 -m "Create v1.0 tag" | |
| git push origin v1.0 | |
| fi |