forked from vernak2539/astro-rehype-relative-markdown-links
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.39 KB
/
npm-publish.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
# yarn dlx np patch --no-publish --message "Release v%s"
name: Publish Package to npmjs
on:
push:
branches: ["main"]
permissions:
actions: write
contents: write
jobs:
publish:
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'Release v')"
environment:
name: npm-publish
steps:
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: "yarn"
- name: Delete non-packaged files # yarn has problems when it comes to packaging, behaving differently from npm
run: rm -rf docs CHANGELOG.md
- name: Install Dependencies
run: yarn --immutable
- name: Publish
run: yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
update_changelog:
needs: publish
runs-on: ubuntu-latest
environment:
name: npm-publish
steps:
- name: Generate CHANGELOG
uses: ./.github/workflows/update-changelog.yml
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
update_docs:
needs: update_changelog
runs-on: ubuntu-latest
environment:
name: npm-publish
steps:
- name: Generate Docs
uses: ./.github/workflows/update-generated-docs.yml