From d3cd9b28df4bd00421062be3e8c654ec4241cce8 Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Fri, 27 Jun 2025 12:17:33 -0300 Subject: [PATCH] feat: using publish-npm-package --- .forgejo/workflows/lhisp-oauth-client.yaml | 51 +++------------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/.forgejo/workflows/lhisp-oauth-client.yaml b/.forgejo/workflows/lhisp-oauth-client.yaml index 2a56161..34285ff 100644 --- a/.forgejo/workflows/lhisp-oauth-client.yaml +++ b/.forgejo/workflows/lhisp-oauth-client.yaml @@ -56,53 +56,16 @@ jobs: id: check uses: https://git.lhprovedor.com.br/leandro/devops/.forgejo/actions/check-package-version@main - publish-to-npm: - runs-on: docker - needs: [build-and-test, check-version] - container: - image: node:20-alpine - if: needs.check-version.outputs.version_changed == 'true' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') - steps: - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - path: dist - name: dist - - - name: Ajusta nome do pacote - if: github.ref == 'refs/heads/master' - run: sed -i "s/-dev//g" dist/package.json - - - name: Publish to NPM (staging) - run: | - cd dist - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - npm publish - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - publish-to-git: + publish: # runs-on: docker container: image: node:20-alpine - needs: [build-and-test, check-version] + needs: [build-and-test] if: needs.check-version.outputs.version_changed == 'true' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') steps: - - name: Download Artifact - uses: actions/download-artifact@v3 + - name: Publish Npm Packages + uses: https://git.lhprovedor.com.br/leandro/devops/.forgejo/actions/publish-npm-package@main with: - path: dist - name: dist - - - name: Ajusta nome do pacote - if: github.ref == 'refs/heads/master' - run: sed -i "s/-dev//g" dist/package.json - - - name: Publish to Git - 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 - npm publish - env: - NPM_TOKEN: ${{ secrets.PACKAGE_PUBLISHER_TOKEN }} + npm_token: ${{ secrets.NPM_TOKEN }} + git_token: ${{ secrets.PACKAGE_PUBLISHER_TOKEN }} + git_username: ${{ leandro }}