Skip to content

Commit 49df023

Browse files
committed
feat: added dual deploy and changesets
1 parent 54af26c commit 49df023

File tree

8 files changed

+727
-78
lines changed

8 files changed

+727
-78
lines changed

.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": "master",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/moody-onions-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@lottiefiles/vue-lottie-player": patch
3+
---
4+
5+
added changesets and dual deploy

.github/workflows/release-old.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [master, beta]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [12.x]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Cache NPM
24+
uses: actions/cache@v2
25+
env:
26+
cache-name: cache-npm
27+
with:
28+
path: ~/.npm
29+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn-lock.json') }}
30+
restore-keys: |
31+
${{ runner.os }}-build-${{ env.cache-name }}-
32+
- name: Setup Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
registry-url: 'https://npm.pkg.github.com'
37+
38+
- name: Install dependencies
39+
run:
40+
yarn |
41+
cd example && yarn
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
45+
- name: Serve example app
46+
continue-on-error: false
47+
run: yarn run serve-app
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
- name: Build project and run tests
51+
continue-on-error: false
52+
run: yarn run run-tests
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
56+
- name: Build project
57+
run: yarn build
58+
59+
- name: Release
60+
run: yarn release
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
65+
GIT_COMMIT: ${{ github.sha }}
66+
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
67+
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
68+
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
69+
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

.github/workflows/release.yml

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@ name: Release
22

33
on:
44
push:
5-
branches: [master, beta]
5+
branches: [master]
66

77
jobs:
8-
release:
9-
name: Release
10-
8+
build:
119
runs-on: ubuntu-latest
10+
timeout-minutes: 15
1211

1312
strategy:
1413
matrix:
15-
node-version: [12.x]
14+
node-version: [14.x]
1615

1716
steps:
1817
- name: Checkout
1918
uses: actions/checkout@v2
2019
with:
2120
fetch-depth: 0
22-
2321
- name: Cache NPM
2422
uses: actions/cache@v2
2523
env:
@@ -33,12 +31,10 @@ jobs:
3331
uses: actions/setup-node@v1
3432
with:
3533
node-version: ${{ matrix.node-version }}
36-
registry-url: 'https://npm.pkg.github.com'
37-
34+
registry-url: "https://npm.pkg.github.com"
3835
- name: Install dependencies
39-
run:
40-
yarn |
41-
cd example && yarn
36+
run: yarn |
37+
cd example && yarn
4238
env:
4339
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4440

@@ -47,6 +43,7 @@ jobs:
4743
run: yarn run serve-app
4844
env:
4945
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
5047
- name: Build project and run tests
5148
continue-on-error: false
5249
run: yarn run run-tests
@@ -56,8 +53,44 @@ jobs:
5653
- name: Build project
5754
run: yarn build
5855

59-
- name: Release
60-
run: yarn release
56+
release-npm:
57+
needs: build
58+
name: Release npm
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v1
62+
- uses: actions/setup-node@v1
63+
with:
64+
node-version: ${{ matrix.node-version }}
65+
registry-url: https://registry.npmjs.org/
66+
- run: yarn install --frozen-lockfile
67+
- run: npm publish --access public
68+
env:
69+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
72+
GIT_COMMIT: ${{ github.sha }}
73+
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
74+
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
75+
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
76+
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
77+
78+
release-gpr:
79+
needs: build
80+
name: Release gpr
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v1
84+
- uses: actions/setup-node@v1
85+
with:
86+
node-version: ${{ matrix.node-version }}
87+
registry-url: https://npm.pkg.github.com/
88+
scope: "@lottiefiles"
89+
- run: yarn install --frozen-lockfile
90+
- run:
91+
echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" >
92+
~/.npmrc
93+
- run: npm publish --@lottiefiles:registry=https://npm.pkg.github.com/
6194
env:
6295
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6396
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,37 @@ set background color.
184184
#### Returns
185185

186186
Type: `void`
187+
188+
## Contributing
189+
190+
We use changesets to maintain a changelog for this repository. When making any change to the codebase that impacts functionality or performance we require a changeset to be present.
191+
192+
To add a changeset run:
193+
194+
```
195+
yarn run changeset
196+
```
197+
198+
And select the type of version bump you'd like (major, minor, path).
199+
200+
You can document the change in detail and format it properly using Markdown by opening the ".md" file that the "yarn changeset" command created in the ".changeset" folder. Open the file, it should look something like this:
201+
202+
```
203+
---
204+
"@lottiefiles/pkg1": minor
205+
"@lottiefiles/pkg2": major
206+
---
207+
208+
This is where you document your **changes** using Markdown.
209+
210+
- You can write
211+
- However you'd like
212+
- In as much detail as you'd like
213+
214+
Aim to provide enough details so that team mates and future you can understand the changes and the context of the change.
215+
```
216+
217+
You can commit your changes and the changeset to your branch and then create a pull request on the develop branch.
187218
## License
188219

189220
MIT License © LottieFiles.com

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lottiefiles/vue-lottie-player",
3-
"version": "1.0.6",
3+
"version": "1.0.5",
44
"description": "Lottie player wrapper for Vue.js by LottieFiles",
55
"scripts": {
66
"build": "vue-cli-service build --target lib --name @lottiefiles/vue-lottie-player ./src/index.js && rm ./dist/demo.html",
@@ -13,6 +13,10 @@
1313
"serve-app": "cd example && yarn && yarn run serve &",
1414
"start-cypress": "yarn run cypress run"
1515
},
16+
"repository": {
17+
"type": "git",
18+
"url": "git+https://github.com/LottieFiles/lottie-vue.git"
19+
},
1620
"main": "dist/@lottiefiles/vue-lottie-player.common.js",
1721
"files": [
1822
"dist"
@@ -22,6 +26,7 @@
2226
"vue": "^2.6.12"
2327
},
2428
"devDependencies": {
29+
"@changesets/cli": "^2.22.0",
2530
"@commitlint/cli": "^12.1.1",
2631
"@commitlint/config-conventional": "^12.1.1",
2732
"@cypress/code-coverage": "^3.9.12",
@@ -72,4 +77,4 @@
7277
"lottiefiles"
7378
],
7479
"license": "MIT"
75-
}
80+
}

0 commit comments

Comments
 (0)