Merge remote-tracking branch 'origin/master' into fix/obsidian-compli… #46
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: Check | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| - master | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run lint | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run test -- --coverage | |
| - id: version | |
| run: echo "version=$(node -p "require('./manifest.json').version")" >> $GITHUB_OUTPUT | |
| artifact: | |
| name: Package Artifact | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run build | |
| - name: Create plugin package | |
| run: | | |
| VERSION=${{ needs.test.outputs.version }} | |
| BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
| BRANCH_NAME_SAFE=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g') | |
| ZIP_NAME="git-files-sync-${VERSION}-${BRANCH_NAME_SAFE}.zip" | |
| zip -j "$ZIP_NAME" main.js manifest.json styles.css | |
| echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: plugin-build-${{ needs.test.outputs.version }}-${{ github.sha }} | |
| path: ${{ env.ZIP_NAME }} | |
| retention-days: 7 |