diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c8ed52d..59d4ff9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,47 +1,49 @@ name: deploy on: - push: + pull_request: branches: - main + types: + - closed +permissions: + id-token: write + contents: read + pages: write +concurrency: + group: pages + cancel-in-progress: false jobs: - build: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 + cache: yarn - id: yarn-cache-path - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - uses: actions/cache@v4 with: path: ${{ steps.yarn-cache-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - - run: yarn install --immutable - - run: yarn demo - - id: deployment - uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action + - name: Build demo page + run: | + yarn install --immutable + yarn demo + - name: Upload demo page + uses: actions/upload-pages-artifact@v3 with: - path: demo/dist/ - - # Deploy job - deploy: - # Add a dependency to the build job - needs: build - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - # Specify runner + deployment step - runs-on: ubuntu-latest - steps: + path: './demo/public' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action - env: - name: preview - url: ${{ steps.deployment.outputs.page_url }} + uses: actions/deploy-pages@v4 + # - name: Publish to NPMJS + # uses: JS-DevTools/npm-publish@v3 + # with: + # token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index c3bd9d7..405e475 100644 --- a/.gitignore +++ b/.gitignore @@ -104,4 +104,5 @@ dist .tern-port lib -.DS_Store \ No newline at end of file +.DS_Store +.secrets diff --git a/LICENSE b/LICENSE index a59b9d0..7257635 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Flowplayer +Copyright (c) 2025 Flowplayer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/demo/index.html b/demo/public/index.html similarity index 100% rename from demo/index.html rename to demo/public/index.html diff --git a/demo/webpack.config.js b/demo/webpack.config.js index f9ac04a..c622de7 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -31,11 +31,11 @@ module.exports = { }, output: { filename: "[name].js", - path: path.resolve(__dirname, "dist") + path: path.resolve(__dirname, "public") }, devServer: { static: { - directory: path.resolve(__dirname) + directory: path.resolve(__dirname, "public") } } } diff --git a/package.json b/package.json index 7545502..d4f5e9f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "author": "Flowplayer AB ", "license": "MIT", "private": false, + "types": "index.d.ts", "scripts": { "build": "tsc -d", "dev": "webpack serve -c demo/webpack.config.js", @@ -38,4 +39,4 @@ "lib/*.js", "lib/*.d.ts" ] -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 55c9ee6..178193b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,12 +7,13 @@ "test/**/*.test-d.tsx" // we have a separate task where types are tested ], "compilerOptions": { - "target": "es2015", + "allowSyntheticDefaultImports": true, + "declaration": false, "jsx": "react", + "moduleResolution": "node", + "outDir": "./lib", "skipLibCheck": true, - "allowSyntheticDefaultImports": true, "strict": true, - "outDir": "./lib", - "moduleResolution": "node" + "target": "es2015", } } \ No newline at end of file