Skip to content

Commit f54b689

Browse files
authored
feat: automate versioning and publish of the package (#16)
* feat: automate versioning and publish of the package * add changeset dependency in package.json file * add changeset
1 parent bdcca8a commit f54b689

6 files changed

Lines changed: 1119 additions & 45 deletions

File tree

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/jolly-pigs-mate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"mostage": minor
3+
---
4+
5+
Added `changeset` as part of package automated versioning and release

.github/workflows/publish.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ name: Publish Package
22

33
on:
44
push:
5-
tags:
6-
- "v*"
5+
branches:
6+
- main
77

88
permissions:
99
contents: write
10+
issues: write
1011
packages: write
12+
pull-requests: write
1113

1214
jobs:
1315
publish:
16+
name: Publish
1417
runs-on: ubuntu-latest
1518
steps:
1619
- name: Checkout repository
@@ -28,26 +31,19 @@ jobs:
2831
registry-url: "https://registry.npmjs.org/"
2932

3033
- name: Install dependencies
31-
run: npm install
34+
run: npm ci
3235

3336
- name: Build project
3437
run: npm run build
3538

36-
- name: Publish to NPM
37-
env:
38-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39-
run: npm publish --registry=https://registry.npmjs.org/
40-
41-
- name: Setup Node.js for GitHub Packages
42-
uses: actions/setup-node@v5
39+
- name: Publish
40+
uses: changesets/action@v1
4341
with:
44-
node-version: "22"
45-
registry-url: "https://npm.pkg.github.com/"
46-
47-
- name: Publish to GitHub Packages
42+
publish: npm run release
43+
version: npx @changesets/cli version
44+
commit: "chore: version package"
45+
title: "chore: version package"
46+
createGithubReleases: true
4847
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
run: |
51-
npm pkg set name=@mostage-app/mostage
52-
npm publish --registry=https://npm.pkg.github.com/ --access public
53-
npm pkg set name=mostage
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)