Compare commits
No commits in common. "4cf6c40e3f8499a9bf4143488777f3998605b5d5" and "9936de05865f1609d5e0d4df2652994c00d1e1e3" have entirely different histories.
4cf6c40e3f
...
9936de0586
2 changed files with 34 additions and 21 deletions
|
@ -73,12 +73,34 @@ jobs:
|
|||
echo "version_changed=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
publish-to-npm:
|
||||
mirror:
|
||||
runs-on: docker
|
||||
needs: [build-and-test, check-version]
|
||||
container:
|
||||
image: node:20-alpine
|
||||
steps:
|
||||
- name: Instalando dependencias
|
||||
run: |
|
||||
apk add git
|
||||
|
||||
- name: Checkout código
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # ✅ clone completo
|
||||
|
||||
- name: Push para o repositório espelho
|
||||
run: |
|
||||
git remote add bitbucket https://leandro_costa:${BITBUCKET_TOKEN}@bitbucket.org/leandro_costa/lhmask.git
|
||||
git push --force bitbucket HEAD
|
||||
env:
|
||||
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
|
||||
|
||||
publish-staging:
|
||||
runs-on: docker
|
||||
needs: [mirror]
|
||||
container:
|
||||
image: node:20-alpine
|
||||
if: needs.check-version.outputs.version_changed == 'true' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master')
|
||||
if: needs.check-version.outputs.version_changed == 'true' && (github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/heads/release-no-verify/'))
|
||||
steps:
|
||||
- name: Download lhmask
|
||||
uses: actions/download-artifact@v3
|
||||
|
@ -86,10 +108,6 @@ jobs:
|
|||
path: lhmask
|
||||
name: lhmask
|
||||
|
||||
- name: Ajusta nome do pacote
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: sed -i "s/-dev//g" lhmask/package.json
|
||||
|
||||
- name: Publish to NPM (staging)
|
||||
run: |
|
||||
cd lhmask
|
||||
|
@ -97,13 +115,12 @@ jobs:
|
|||
npm publish
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
publish-to-git:
|
||||
publish-production:
|
||||
runs-on: docker
|
||||
needs: [mirror]
|
||||
container:
|
||||
image: node:20-alpine
|
||||
needs: [build-and-test]
|
||||
if: needs.check-version.outputs.version_changed == 'true' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master')
|
||||
if: needs.check-version.outputs.version_changed == 'true' && github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- name: Download lhmask
|
||||
uses: actions/download-artifact@v3
|
||||
|
@ -111,23 +128,19 @@ jobs:
|
|||
path: lhmask
|
||||
name: lhmask
|
||||
|
||||
- name: Ajusta nome do pacote
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: sed -i "s/-dev//g" lhmask/package.json
|
||||
|
||||
- name: Publish to Git
|
||||
- name: Publish to NPM (staging)
|
||||
run: |
|
||||
npm config set registry https://git.lhprovedor.com.br/api/packages/leandro/npm/
|
||||
npm config set -- '//git.lhprovedor.com.br/api/packages/leandro/npm/:_authToken' "${NPM_TOKEN}"
|
||||
cd lhmask
|
||||
sed -i "s/-dev//g" package.json
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||
npm publish
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.PACKAGE_PUBLISHER_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
finish:
|
||||
runs-on: docker
|
||||
needs: [build-and-test, publish-to-npm, publish-to-git]
|
||||
container:
|
||||
image: node:20-alpine
|
||||
steps:
|
||||
- run: echo Done
|
||||
- name: Finish task
|
||||
run: echo Done
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.lhprovedor.com.br/leandro/lhmask.git"
|
||||
"url": "git+ssh://git@bitbucket.org/leandro_costa/lhmask.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue