Merge branch 'main' of https://github.com/Srabutdotcom/enum #98
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
| # .github/workflows/publish.yml | |
| name: Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| inject-and-publish: | |
| if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write # The OIDC ID token is used for authentication with JSR. | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| # uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31 # v1.1.2 | |
| with: | |
| deno-version: v2.x | |
| - name: Run linter | |
| run: deno lint src/ --rules-exclude=no-var, no-explicit-any | |
| - name: Run tests | |
| run: deno test test/*.js | |
| - name: Run Inject Version | |
| run: deno run --allow-read --allow-write type/version.js | |
| - name: Commit and push version bump | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Handoko" | |
| # Force add even unchanged files by touching them | |
| find type/ -type f -exec touch {} \; | |
| git add type/ | |
| git commit -m "chore: inject version [skip ci]" || echo "No changes to commit" | |
| git push | |
| - name: Publish to JSR | |
| run: npx jsr publish --allow-dirty --allow-slow-types |