Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
werthdavid authored Apr 19, 2023
2 parents 31eb5ea + 7523108 commit a016f98
Show file tree
Hide file tree
Showing 715 changed files with 16,726 additions and 8,576 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Continuous Integration

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build the application
run: yarn build

- name: E2E Test the application
run: yarn test
54 changes: 0 additions & 54 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

58 changes: 11 additions & 47 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -27,21 +27,21 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build the application
run: yarn build

- name: Test the application
run: yarn test

- name: Build the application
run: yarn build

- name: Build the package
run: |
npm pack
npm pack dist/
mv zxing-library-*.tgz package.tgz
- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand All @@ -58,47 +58,11 @@ jobs:
with:
name: pack-artifact

- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 18
registry-url: https://registry.npmjs.org/

- run: npm publish ./pack-artifact/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:

- name: Download build artifacts
uses: actions/download-artifact@v1
with:
name: pack-artifact

- name: Install JQ for JSON handling
run: sudo apt-get install jq

- name: Get repository name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")
shell: bash

- name: Rename NPM package
run: |
ORG_NAME="zxing-js"
PACKAGE_NAME="@$ORG_NAME/$REPOSITORY_NAME"
tar -xzf ./pack-artifact/package.tgz
cd ./package
mv package.json temp.json
jq -r --arg NAME $PACKAGE_NAME '.name |= $NAME' temp.json > package.json
rm temp.json
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/

- run: npm publish ./pack-artifact/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ node_modules/
*.iml

coverage
esm
esm5
umd
typings
dist
output

## this is generated by `npm pack`
*.tgz
Expand Down
17 changes: 0 additions & 17 deletions .npmignore

This file was deleted.

32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

43 changes: 35 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,45 @@
{
"type": "node",
"request": "launch",
"name": "EAN 13 Tests",
"program": "${workspaceFolder}/node_modules/mocha-webpack/bin/mocha-webpack",
"name": "Code 93 Tests - ts-node",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"env": {
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.test.json"
},
"args": [
"./src/test/core/oned/Ean13*.spec.ts",
"--require",
"ts-node/register",
"--require",
"tsconfig-paths/register",
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"--recursive",
"./src/test/core/oned/Code93*.spec.ts"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "EAN 13 Tests - ts-node",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--require",
"ts-node/register",
"--require",
"tsconfig-paths/register",
"-u",
"tdd",
"--timeout",
"999999",
"--webpack-env",
"dbg",
"--webpack-config",
"webpack.config.test.js"
]
"--colors",
"--recursive",
"./src/test/core/oned/Ean13*.spec.ts"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
Expand Down
Loading

0 comments on commit a016f98

Please sign in to comment.