diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6748844a..b9226778 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -25,3 +25,43 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm test + + package: + needs: [test] + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - run: npm ci + - run: npm run build + - run: npm version prerelease --preid=ci-$GITHUB_RUN_ID --no-git-tag-version + - run: npm pack + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: package + path: "*.tgz" + + publish: + name: "Publish to GitHub Packages" + needs: [package] + runs-on: ubuntu-18.04 + if: github.repository_owner == 'manekinekko' # && github.token != '' + steps: + - name: Upload + uses: actions/download-artifact@v2 + with: + name: package + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: https://npm.pkg.github.com/ + scope: "@manekinekko" + - run: echo "registry=https://npm.pkg.github.com/@manekinekko" >> .npmrc + - run: npm publish $(ls *.tgz) + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 22e8db74..6e7eede6 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,5 @@ __pycache__/ *.py[cod] *$py.class -dist \ No newline at end of file +dist +*.tgz diff --git a/.npmignore b/.npmignore index 1927772b..c05ed8f8 100644 --- a/.npmignore +++ b/.npmignore @@ -1 +1,8 @@ -local.settings.json \ No newline at end of file +local.settings.json +.vscode +.github +.release-it.json +.editorconfig +.tsconfig +.nvmrc +.prettierrc