-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.58 KB
/
deploy.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build and publish library
permissions:
actions: read
contents: write
packages: write
id-token: write
on:
push:
branches: ['main']
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
jobs:
build:
if: "!contains(github.event.head_commit.message, 'docs:')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.3
- run: bun install --frozen-lockfile
- run: bun run tsc
- run: bun run lint
- run: bun run build-cli
- run: bun run sanity-check
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://npm.pkg.github.com'
scope: '@navikt'
- run: npm publish
if: github.ref == 'refs/heads/main'
working-directory: ./tsm-cli
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
increment-version:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Setup github connection for auth
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- run: jq --arg version "1.0.$(date +%F-%H%M)" '.version = $version' package.json > updated.json && mv updated.json package.json
working-directory: ./tsm-cli
- run: git add . && git commit -m "[skip ci] bump version to $(jq -r .version tsm-cli/package.json)" && git push