Skip to content

Commit

Permalink
feat: added getVersions, updated lottie-web, updated release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelOsborne committed Dec 6, 2022
1 parent 086c17e commit 0581409
Show file tree
Hide file tree
Showing 8 changed files with 16,707 additions and 821 deletions.
Binary file modified .DS_Store
Binary file not shown.
71 changes: 57 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Release

on:
push:
branches: [master, beta]
branches: [master]

jobs:
release:
name: Release

build:
runs-on: ubuntu-latest
timeout-minutes: 15

strategy:
matrix:
Expand All @@ -19,7 +18,6 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Cache NPM
uses: actions/cache@v2
env:
Expand All @@ -29,31 +27,76 @@ jobs:
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://npm.pkg.github.com"

- name: Install dependencies
run: yarn install
run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Run linting
run: yarn lint
- name: Build project
run: yarn build
- name: Serve example app
continue-on-error: false
run: yarn run serve
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Build project and run tests
continue-on-error: false
run: yarn run run-tests
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

release-npm:
needs: build
name: Release npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- name: Build project
continue-on-error: false
run: yarn build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
GIT_COMMIT: ${{ github.sha }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

- name: Release
run: yarn release
release-gpr:
needs: build
name: Release gpr
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://npm.pkg.github.com/
scope: "@lottiefiles"
- run: yarn install --frozen-lockfile
- name: Build project
continue-on-error: false
run: yarn build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run:
echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" >
~/.npmrc
- run: npm publish --@lottiefiles:registry=https://npm.pkg.github.com/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lottiefiles/lottie-player",
"version": "1.6.1",
"version": "1.6.2",
"description": "Lottie animation and Telegram Sticker player web components.",
"main": "dist/lottie-player.js",
"module": "dist/lottie-player.esm.js",
Expand All @@ -11,7 +11,9 @@
"author": "Jawish Hameed <jawish@lottiefiles.com>",
"license": "MIT",
"scripts": {
"prestart": "node -p \"'export const LOTTIE_PLAYER_VERSION = ' + JSON.stringify(require('./package.json').version) + '; \\n' + 'export const LOTTIE_WEB_VERSION = ' + JSON.stringify(require('./package.json').dependencies['lottie-web']) + ';'\" > src/versions.ts",
"start": "npm run cleanup && rollup -c --watch",
"prebuild": "node -p \"'export const LOTTIE_PLAYER_VERSION = ' + JSON.stringify(require('./package.json').version) + '; \\n' + 'export const LOTTIE_WEB_VERSION = ' + JSON.stringify(require('./package.json').dependencies['lottie-web']) + ';'\" > src/versions.ts",
"build": "npm run cleanup && npm run build-lottie && npm run build-tgs",
"build-with-coverage": "npm run cleanup && CODE_COVERAGE=true npm run build-lottie && CODE_COVERAGE=true npm run build-tgs",
"build-lottie": "rollup -c ",
Expand All @@ -30,7 +32,7 @@
"dependencies": {
"@types/pako": "^1.0.1",
"lit": "^2.1.2",
"lottie-web": "^5.9.6",
"lottie-web": "^5.10.0",
"pako": "^2.0.4",
"resize-observer-polyfill": "^1.5.1"
},
Expand Down
Loading

0 comments on commit 0581409

Please sign in to comment.