Snapshot #4421
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: Snapshot | |
| on: | |
| workflow_run: | |
| workflows: | |
| - CI | |
| types: | |
| - completed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| snapshot: | |
| runs-on: ubuntu-latest | |
| if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' | |
| name: "Publish Snapshot" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20.x | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm install | |
| - run: | | |
| git config --global user.email "j5ik2o@gmail.com" | |
| git config --global user.name "Junichi Kato" | |
| npm version prerelease --preid=snapshot --no-git-tag-version | |
| SNAPSHOT_VERSION=$(npm version --json | jq -r '.["event-store-adapter-js"]') | |
| git add . | |
| git commit -m "[skip ci] version up to ${SNAPSHOT_VERSION}" | |
| git push origin main | |
| - run: npm run build | |
| - run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |