ci: generate npm package (#31)
* working on automated pre-release builds * checking condition is valid * pushing to github packages * playing with scopes * moving to separate job * forgot to download the artifact * don't need to install when the package already exists
This commit is contained in:
Родитель
bb5fe2e3a6
Коммит
f2b3e20097
|
@ -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}}
|
|
@ -43,3 +43,4 @@ __pycache__/
|
|||
*$py.class
|
||||
|
||||
dist
|
||||
*.tgz
|
||||
|
|
|
@ -1 +1,8 @@
|
|||
local.settings.json
|
||||
.vscode
|
||||
.github
|
||||
.release-it.json
|
||||
.editorconfig
|
||||
.tsconfig
|
||||
.nvmrc
|
||||
.prettierrc
|
||||
|
|
Загрузка…
Ссылка в новой задаче