forked from airbnb/hypernova
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.26 KB
/
publish-release.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
name: Publish Release
on:
release:
types: [published]
jobs:
publish-release:
name: Publish release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build
- name: Configure git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
- name: Update package.json version
run: |
# get version from tag and update package.json
VERSION=${GITHUB_REF#refs/tags/}
echo "Setting version in package.json to ${VERSION}"
npm version ${VERSION} --no-git-tag-version
# push to main
git add package.json
git commit -m "[no-release-draft] Update package.json to version ${VERSION}"
git push -u origin main
# move tag to HEAD
git push --force origin "HEAD:refs/tags/${VERSION}"
git fetch --tags
- name: Publish to Github Packages
run: npm publish