1.0.4 #12
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: Publish Package | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| build-test-and-publish: | |
| runs-on: ubuntu-latest | |
| container: node:20 | |
| permissions: | |
| packages: write | |
| services: | |
| redis: | |
| image: redis:7.0 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y unzip | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install project dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| - name: Test | |
| env: | |
| REDIS_URL: redis://redis:6379 | |
| run: bun run test | |
| - name: Copy extra files | |
| run: cp ./README.md ./LICENSE ./packages/cache | |
| - name: Publish package to NPM | |
| env: | |
| NPM_CONFIG_TOKEN: ${{ secrets.NPM_CONFIG_TOKEN }} | |
| run: cd ./packages/cache && bun publish --tolerate-republish --access public | |
| - name: Publish package to GitHub | |
| env: | |
| NPM_CONFIG_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: cd ./packages/cache && bun publish --tolerate-republish --access public --registry https://npm.pkg.github.com |