-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.2 KB
/
release.yaml
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
---
name: Release
# yamllint disable rule:truthy
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Build
run: bun build:lib
- name: Read changelog
id: changelog
run: echo "::set-output name=changelog::$(bun changelog)"
- name: Release
id: create_release
if: steps.changelog.outputs.changelog != ''
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
# body: the changelog
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Publish to NPM
if: steps.create_release.outputs.id
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: bun publish