Skip to content

Commit

Permalink
Try do to npm publication
Browse files Browse the repository at this point in the history
  • Loading branch information
vinimarcili committed Aug 25, 2023
1 parent df3bd68 commit a6667fd
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/deploy-cdn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to Hub CDN on merge Master
on:
push:
branches:
- master
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "18"

- name: Auth GCloud
uses: "google-github-actions/auth@v0"
with:
credentials_json: "${{ secrets.GCE_AUTH_JSON }}"

- name: Install dependencies and build 🔧
run: npm install && npm run build:prod

- name: Upload CSS
uses: "google-github-actions/upload-cloud-storage@v0"
with:
path: "dist/@squid-css/ngx-css"
destination: "ngx-css"
53 changes: 53 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy to GitHub Pages on merge Master
on:
push:
branches:
- master
jobs:
deploy:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "18"
# - name: Obtain GitHub App Installation Access Token
# id: githubAppAuth
# run: |
# TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GH_APP_CREDENTIALS_TOKEN_JWT }})"
# echo "::add-mask::$TOKEN"
# echo "::set-output name=token::$TOKEN"
# - name: Use the obtained token
# id: tokenEnv
# run: |
# curl -X POST -H 'Content-Type: application/json' \
# -d '{"context":"test","state":"success"}' \
# "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA?access_token=$GITHUB_TOKEN"
# - name: Setup Auth ENV
# env:
# email: "developers@squidit.com.br"
# username: "squidit"
# run: |
# git config --global credential.helper store
# echo "https://${{ steps.githubAppAuth.outputs.token }}:x-oauth-basic@github.com" > ~/.git-credentials
# git config --global user.email $email
# git config --global user.name $username
# - name: Deploy to gh-pages
# run: |
# npm install
# npm run dist
# cp -r dist/css src/docs/public
# cp -r dist/js src/docs/public
# cd src/docs
# npm install
# NODE_ENV=production npm run build
# cd ../..
# echo "css.squidit.com.br" > CNAME
# cd docs
# echo "css.squidit.com.br" > CNAME
# cd ..
# git init
# git add -A
# git commit -m "🚀 Deploy id ${GITHUB_RUN_ID}" --no-verify
# git push -f "https://github.com/${GITHUB_REPOSITORY}.git" HEAD:gh-pages
22 changes: 22 additions & 0 deletions .github/workflows/deploy-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish to NPM
on:
release:
types: [created]
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies and build 🔧
run: npm install && npm run build:prod
- name: Publish package on NPM 📦
run: cd src && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@
"type": "git",
"url": "git+https://github.com/squidit/ngx-css.git"
},
"main": "dist/js/squid.min.js",
"style": "dist/css/squid.min.css",
"description": "Squid CSS Styleguide",
"description": "Squid NGX CSS Docs",
"bugs": {
"url": "https://github.com/squidit/ngx-css/issues"
},
Expand Down
25 changes: 24 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,28 @@
"dependencies": {
"tslib": "^2.3.0"
},
"sideEffects": false
"sideEffects": false,
"keywords": [
"css",
"sass",
"responsive",
"front-end",
"framework",
"web",
"angular"
],
"files": [
"dist/@squidit/ngx-css/**/*.*"
],
"repository": {
"type": "git",
"url": "git+https://github.com/squidit/ngx-css"
},
"description": "Squid CSS Styleguide",
"bugs": {
"url": "https://github.com/squidit/ngx-css/issues"
},
"homepage": "https://github.com/squidit/ngx-css",
"author": "Squid <developers@squidit.com.br>",
"license": "MIT"
}

0 comments on commit a6667fd

Please sign in to comment.