Merge pull request 'development' (#7) from development into master
All checks were successful
All checks were successful
Reviewed-on: leandro/lhmask#7
This commit is contained in:
commit
4cf6c40e3f
2 changed files with 21 additions and 34 deletions
|
@ -73,34 +73,12 @@ jobs:
|
||||||
echo "version_changed=false" >> "$GITHUB_OUTPUT"
|
echo "version_changed=false" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mirror:
|
publish-to-npm:
|
||||||
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' || startsWith(github.ref, 'refs/heads/release-no-verify/'))
|
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
|
||||||
|
@ -108,6 +86,10 @@ 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
|
||||||
|
@ -115,12 +97,13 @@ 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
|
||||||
if: needs.check-version.outputs.version_changed == 'true' && github.ref == 'refs/heads/master'
|
needs: [build-and-test]
|
||||||
|
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
|
||||||
|
@ -128,19 +111,23 @@ jobs:
|
||||||
path: lhmask
|
path: lhmask
|
||||||
name: lhmask
|
name: lhmask
|
||||||
|
|
||||||
- name: Publish to NPM (staging)
|
- name: Ajusta nome do pacote
|
||||||
|
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.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.PACKAGE_PUBLISHER_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:
|
||||||
- name: Finish task
|
- run: echo Done
|
||||||
run: echo Done
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+ssh://git@bitbucket.org/leandro_costa/lhmask.git"
|
"url": "https://git.lhprovedor.com.br/leandro/lhmask.git"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue