-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (38 loc) · 1.21 KB
/
snapshot.yml
File metadata and controls
38 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 }}