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"
|
echo "version_changed=false" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
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
|
runs-on: docker
|
||||||
needs: [mirror]
|
needs: [mirror]
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
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:
|
steps:
|
||||||
- name: Download lhmask
|
- name: Download lhmask
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
@ -86,10 +108,6 @@ jobs:
|
||||||
path: lhmask
|
path: lhmask
|
||||||
name: 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)
|
- name: Publish to NPM (staging)
|
||||||
run: |
|
run: |
|
||||||
cd lhmask
|
cd lhmask
|
||||||
|
@ -97,13 +115,12 @@ jobs:
|
||||||
npm publish
|
npm publish
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
publish-production:
|
||||||
publish-to-git:
|
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
needs: [mirror]
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
needs: [build-and-test]
|
if: needs.check-version.outputs.version_changed == 'true' && github.ref == 'refs/heads/master'
|
||||||
if: needs.check-version.outputs.version_changed == 'true' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master')
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download lhmask
|
- name: Download lhmask
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
@ -111,23 +128,19 @@ jobs:
|
||||||
path: lhmask
|
path: lhmask
|
||||||
name: lhmask
|
name: lhmask
|
||||||
|
|
||||||
- name: Ajusta nome do pacote
|
- name: Publish to NPM (staging)
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
run: sed -i "s/-dev//g" lhmask/package.json
|
|
||||||
|
|
||||||
- name: Publish to Git
|
|
||||||
run: |
|
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
|
cd lhmask
|
||||||
|
sed -i "s/-dev//g" package.json
|
||||||
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||||
npm publish
|
npm publish
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.PACKAGE_PUBLISHER_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [build-and-test, publish-to-npm, publish-to-git]
|
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
steps:
|
steps:
|
||||||
- run: echo Done
|
- name: Finish task
|
||||||
|
run: echo Done
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lhprovedor.com.br/leandro/lhmask.git"
|
"url": "git+ssh://git@bitbucket.org/leandro_costa/lhmask.git"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue