ci: organizando publish
All checks were successful
All checks were successful
This commit is contained in:
parent
42d7d9eea0
commit
0b482f85d8
1 changed files with 13 additions and 33 deletions
|
@ -73,12 +73,12 @@ jobs:
|
||||||
echo "version_changed=false" >> "$GITHUB_OUTPUT"
|
echo "version_changed=false" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
publish-staging:
|
publish-to-npm:
|
||||||
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
|
||||||
|
@ -86,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
|
||||||
|
@ -93,45 +97,24 @@ jobs:
|
||||||
npm publish
|
npm publish
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
publish-production:
|
|
||||||
runs-on: docker
|
|
||||||
needs: [mirror]
|
|
||||||
container:
|
|
||||||
image: node:20-alpine
|
|
||||||
if: needs.check-version.outputs.version_changed == 'true' && github.ref == 'refs/heads/master'
|
|
||||||
steps:
|
|
||||||
- name: Download lhmask
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
path: lhmask
|
|
||||||
name: lhmask
|
|
||||||
|
|
||||||
- name: Publish to NPM (staging)
|
publish-to-git:
|
||||||
run: |
|
|
||||||
cd lhmask
|
|
||||||
sed -i "s/-dev//g" package.json
|
|
||||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
||||||
npm publish
|
|
||||||
env:
|
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
|
|
||||||
publish-git:
|
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
needs: [build-and-test]
|
needs: [build-and-test]
|
||||||
if: needs.check-version.outputs.version_changed == 'true'
|
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
|
||||||
with:
|
with:
|
||||||
path: lhmask
|
path: lhmask
|
||||||
name: lhmask
|
name: lhmask
|
||||||
|
|
||||||
- name: Ajusta nome do pacote
|
- name: Ajusta nome do pacote
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: sed -i "s/-dev//g" lhmask/package.json
|
||||||
cd lhmask
|
|
||||||
sed -i "s/-dev//g" package.json
|
|
||||||
- name: Publish to Git
|
- name: Publish to Git
|
||||||
run: |
|
run: |
|
||||||
npm config set registry https://git.lhprovedor.com.br/api/packages/leandro/npm/
|
npm config set registry https://git.lhprovedor.com.br/api/packages/leandro/npm/
|
||||||
|
@ -143,11 +126,8 @@ jobs:
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [publish-staging, publish-production, publish-git, build-and-test]
|
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
|
|
||||||
- name: Publish to Git
|
|
||||||
run: npm publish
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue