Skip to content

Commit

Permalink
publish when merge to main
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonsterczewski committed Jul 25, 2024
1 parent 6d1f058 commit b189871
Showing 1 changed file with 27 additions and 102 deletions.
129 changes: 27 additions & 102 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,102 +1,3 @@
##name: Publish to pnpm
##
##on:
## push:
## branches:
## - main
##
##jobs:
## publish:
## runs-on: ubuntu-latest
##
## steps:
## - name: Checkout repository
## uses: actions/checkout@v4
##
## - name: Setup Node.js
## uses: actions/setup-node@v4
## with:
## node-version: '20'
## registry-url: 'https://registry.npmjs.org'
##
## - name: Install dependencies
## run: npm install
## - name: Whoami
## env:
## GH_TOKEN: ${{ github.token }}
## run: |
## git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
## git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
## git config -l
## - name: Bump version and tag
## id: bump_version
## run: |
## VERSION=$(npm version patch -m "chore(release): %s")
## - name: Push new tag to repository
## env:
## GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## run: |
## git push origin HEAD:main --tags
## - name: Publish to pnpm
## env:
## NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
## run: |
## npm adduser
## npm whoami
## npm publish
#
#
#name: Publish to npm
#
#on:
# push:
# branches:
# - main
#
#jobs:
# publish:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '20'
# registry-url: 'https://registry.npmjs.org'
# always-auth: true
# - name: Whoami
# env:
# GH_TOKEN: ${{ github.token }}
# run: |
# git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
# git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
# git config -l
#
# - name: Install dependencies
# run: npm install
#
# - name: test config
# run: cat $NPM_CONFIG_USERCONFIG
#
# - name: Build
# run: npm run build
#
# - name: Bump version and push tag
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# npx standard-version --release-as patch
# git push --follow-tags origin main
#
# - name: Publish to npm
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# npm publish

on:
push:
branches:
Expand All @@ -115,6 +16,30 @@ jobs:
node-version: 20
registry-url: https://registry.npmjs.org
always-auth: true
- run: npm install
- run: npm run build
- run: npm publish

- name: Github Config
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
git config -l
- name: Install
run: npm install

- name: Build
run: npm run build

- name: Bump version and tag
run: |
VERSION=$(npm version patch -m "chore(release): %s")
- name: Push new tag to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin HEAD:main --tags
- name: Publish
run: npm publish

0 comments on commit b189871

Please sign in to comment.