-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpm-publish-github-packages.yml
More file actions
84 lines (69 loc) · 2.17 KB
/
Copy pathnpm-publish-github-packages.yml
File metadata and controls
84 lines (69 loc) · 2.17 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This workflow will build and publish a package to GitHub Packages
# For more information see: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
name: Publish to GitHub Packages
on:
push:
branches:
- master
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
registries: |
https://registry.npmjs.org/
@jazz-man:https://npm.pkg.github.com/|$GITHUB_TOKEN
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2
- name: Run Biome
run: biome ci
- name: Build binary
run: bun run build
- name: Run tests
run: bun test
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1
id: bump
env:
GITHUB_TOKEN: ${{ github.token }}
MAJOR_STRING_TOKEN: '#major'
MINOR_STRING_TOKEN: '#minor'
PATCH_STRING_TOKEN: '#patch'
NONE_STRING_TOKEN: '#none'
TAG_PREFIX: v
VERBOSE: false
- name: Build Changelog
id: changelog
uses: loopwerk/tag-changelog@v1
with:
token: ${{ github.token }}
- name: Release
uses: softprops/action-gh-release@v2
with:
token: ${{ github.token }}
generate_release_notes: true
append_body: true
make_latest: true
tag_name: ${{ steps.bump.outputs.tag }}
name: ${{ steps.bump.outputs.tag }}
body: ${{ steps.changelog.outputs.changelog }}
- name: Bump version and publish
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
bun pm version ${{ steps.bump.outputs.tag }} --no-git-tag-version
bun publish \
--tag ${{ steps.bump.outputs.tag }} \
--tolerate-republish \
--production